Skip to content

Commit 473ee8e

Browse files
committed
merge bitcoin#24195: Fix failfast option for functional test runner
1 parent 64dd467 commit 473ee8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/test_runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,11 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
573573

574574
max_len_name = len(max(test_list, key=len))
575575
test_count = len(test_list)
576+
all_passed = True
576577
i = 0
577578
while i < test_count:
579+
if failfast and not all_passed:
580+
break
578581
for test_result, testdir, stdout, stderr in job_queue.get_next():
579582
test_results.append(test_result)
580583
i += 1
@@ -584,6 +587,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
584587
elif test_result.status == "Skipped":
585588
logging.debug("%s skipped" % (done_str))
586589
else:
590+
all_passed = False
587591
print("%s failed, Duration: %s s\n" % (done_str, test_result.time))
588592
print(BOLD[1] + 'stdout:\n' + BOLD[0] + stdout + '\n')
589593
print(BOLD[1] + 'stderr:\n' + BOLD[0] + stderr + '\n')
@@ -617,7 +621,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
617621
if not os.listdir(tmpdir):
618622
os.rmdir(tmpdir)
619623

620-
all_passed = all(map(lambda test_result: test_result.was_successful, test_results)) and coverage_passed
624+
all_passed = all_passed and coverage_passed
621625

622626
# Clean up dangling processes if any. This may only happen with --failfast option.
623627
# Killing the process group will also terminate the current process but that is

0 commit comments

Comments
 (0)