Skip to content

Commit 5ebb2f1

Browse files
committed
add fallback if integration test log extraction fails
1 parent 807c012 commit 5ebb2f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ci/jobs/scripts/integration_tests_runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,13 @@ def matches_substring(substring, log, is_regex):
583583
test_logs = extract_fail_logs(log_path)
584584
test_log = test_logs.get(failed_test.split("::")[-1])
585585
if test_log is None:
586+
# Log extraction can fail if the fail was in the teardown
586587
log_file.write(
587-
f"WARNING: Test '{failed_test}' has no logs among {test_logs.keys()}\n"
588+
f"WARNING: Test '{failed_test}' has no logs among {list(test_logs.keys())}, assuming log extraction failed, proceeding with full log\n"
588589
)
590+
with open(log_path, "r", encoding="utf-8") as f:
591+
test_log = f.read()
592+
589593
known_fail_reason = test_is_known_fail(
590594
failed_test, test_log, log_file
591595
)

0 commit comments

Comments
 (0)