Skip to content

Commit 8f161bb

Browse files
sbryngelsonclaude
andcommitted
Hoist failed_uuids_path to single assignment in test()
Eliminates duplicated os.path.join computation in abort and normal code paths, reducing divergence risk. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e55de30 commit 8f161bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

toolchain/mfc/test/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ def test():
179179
cons.print(" Progress Test Name Time(s) UUID")
180180
cons.print()
181181

182+
failed_uuids_path = os.path.join(common.MFC_TEST_DIR, "failed_uuids.txt")
183+
182184
# Select the correct number of threads to use to launch test cases
183185
# We can't use ARG("jobs") when the --case-optimization option is set
184186
# because running a test case may cause it to rebuild, and thus
@@ -191,7 +193,6 @@ def test():
191193
# Check if we aborted due to high failure rate
192194
if abort_tests.is_set():
193195
# Clean up stale failed_uuids.txt so CI doesn't retry wrong tests
194-
failed_uuids_path = os.path.join(common.MFC_TEST_DIR, "failed_uuids.txt")
195196
try:
196197
if os.path.exists(failed_uuids_path):
197198
os.remove(failed_uuids_path)
@@ -223,7 +224,6 @@ def test():
223224
_print_test_summary(nPASS, nFAIL, nSKIP, minutes, seconds, failed_tests, skipped_cases)
224225

225226
# Write failed UUIDs to file for CI retry logic
226-
failed_uuids_path = os.path.join(common.MFC_TEST_DIR, "failed_uuids.txt")
227227
if failed_tests:
228228
with open(failed_uuids_path, "w") as f:
229229
for test_info in failed_tests:

0 commit comments

Comments
 (0)