Skip to content

Commit

Permalink
Update run_conformance.py
Browse files Browse the repository at this point in the history
include retry
  • Loading branch information
y1k2chaitanya committed Apr 19, 2024
1 parent 7dc9593 commit 876baff
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test_conformance/run_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import tempfile

DEBUG = 0
retry=0


log_file_name = "opencl_conformance_results_" + time.strftime("%Y-%m-%d_%H-%M", time.localtime()) + ".log"
process_pid = 0
Expand Down Expand Up @@ -213,6 +215,7 @@ def run_tests(tests):
failures = 0
previous_test = None
test_number = 1
failed_tests=[]
for test in tests:
# Print the name of the test we're running and the time
(test_name, test_dir) = test
Expand Down Expand Up @@ -266,16 +269,20 @@ def run_tests(tests):

print("")
if result != 0:
#retry once again for failures
log_file.write(" *******************************************************************************************\n")
log_file.write(" * (" + get_time() + ") Test " + test_name + " ==> FAILED: " + str(result) + "\n")
log_file.write(" *******************************************************************************************\n")
failures = failures + 1
#keep failed test_name in a list

failed_tests.append(test)
else:
log_file.write(" (" + get_time() + ") Test " + test_name + " passed in " + str(run_time) + "s\n")

log_file.write(" ----------------------------------------------------------------------------------------\n")
log_file.write("\n")
return failures
return failures,failed_tests


# ########################
Expand Down Expand Up @@ -353,12 +360,20 @@ def run_tests(tests):
write_screen_log(("Setting CL_DEVICE_TYPE to " + device_to_test).center(90))
write_screen_log("========================================================================================")
write_screen_log("========================================================================================")
failures = run_tests(tests)
failures,failed_tests = run_tests(tests)
write_screen_log("========================================================================================")
if failures == 0:
write_screen_log(">> TEST on " + device_to_test + " PASSED")
else:
write_screen_log(">> TEST on " + device_to_test + " FAILED (" + str(failures) + " FAILURES)")
write_screen_log("Failed tests are"+ str(failed_tests))
#if retry <2 then retry the failed tests
write_screen_log("Retrying failed tests")
if retry < 2:
failures,failed_tests = run_tests(failed_tests)
retry=retry+1


write_screen_log("========================================================================================")
total_failures = total_failures + failures

Expand Down

0 comments on commit 876baff

Please sign in to comment.