Repository navigation
progress_dashboard: recover parse_lasttest after incomplete nested CTest logs (DASH-CTEST-INCOMPLETE-NESTED) - #1256
Conversation
|
I reran the real CTest 3.31.10 fixture against this PR on Linux: base lost both results with the truncated log; |
|
Thanks for testing against the real CTest 3.31.10 fixture and spotting the quadratic slice, @titoreinaldo! Pushed |
|
I reproduced a case where the dashboard drops the following test as well as the failed wrapper. On 8d2aa7b, Windows 11, Python 3.12.10, CTest 4.4.4, I generated three LastTest.log files using real CTest runs:
At the real wrapper trailer both nested Output blocks are still open, so the recovery guarded by CPU-only, synthetic output, AI-assisted review. |
|
Great catch, @DeadlyChirp — reproduced your exact 3-level Pushed
Verified |
What changed
Fixes
parse_lasttestintools/progress_dashboard.pyso an incomplete nested CTest log inside a test's capturedOutput:block (such as a nested run missing its trailingEnd testing:line, or truncated mid-output) no longer swallows the outer test's verdict and all subsequent outer test results.Addresses the findings in #14 (finding #7143409370 and the real CTest 3.31.10 fixture in finding #7144069427).
Why this works even when inner and outer share name, ordinal, and timestamps
In CTest
LastTest.log, every test output inside a nested run is bracketed byOutput:+ 58 dashes and<end of output>+Test time =. Instead of a flatnested_runscounter that can only close onEnd testing:,parse_lasttestnow tracks a stack of[in_output, inner_test_name]frames for each nestedStart testing:+ 58-dash block:Output:+ 58 dashes setsin_output = Truefor the innermost nested run, and the inner test's<end of output>flips it back toFalsewhile staying inside outer capture (so innerwrapperpass verdicts are still ignored even when name, ordinal, and timestamps match the outer test).<end of output>+Test time =arrives within_output == Falseon the top nested frame(s), no innerOutput:block is open, so those completed-but-unclosed nested runs (missingEnd testing:) are popped cleanly; if the stack empties, outer capture ends immediately, and in 3-level nesting an enclosing middle test'sOutput:closes while staying inside outer capture.Output:before its own<end of output>,_trailer_end_time_matcheschecks the immediate"<name>" end time:trailer (stopping at the first end-time line or second 58-dash separator) to resynchronize on the outer test.End testing:lines printed inside a nested test's capturedOutput:are ignored whilein_outputisTrue, preventing premature exit from outer capture.Tests added (
tests/test_progress_dashboard.py)test_lasttest_recovers_when_nested_log_omits_end_testing(reproduces the real CTest 3.31.10 fixture: outerwrapper1/2 fails, innerwrapper1/2 passes +child_22/2 passes with identical timestamps and missingEnd testing:, followed by outerlater2/2 passing).test_lasttest_recovers_from_empty_incomplete_nested_log(reproduces finding #7143409370).test_lasttest_handles_three_level_nested_log_missing_innermost_end_testing.test_lasttest_recovers_when_inner_test_output_is_truncated_mid_stream.test_lasttest_ignores_spurious_end_testing_inside_nested_test_output.Item ID
DASH-CTEST-INCOMPLETE-NESTEDVerification
Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only):
python3 -I tests/test_progress_dashboard.py -v-> 56/56 OKtools/progress_dashboard.pytoupstream/mainwhile keepingtests/test_progress_dashboard.py) -> FAILED (5 failures): all 5 new tests fail onmain(4 return[], 1 falsely reports('wrapper', 'pass', 0.01)instead of('wrapper', 'fail', 0.15)); restoring the fix returns to 56/56 OK.python3 -m compileall -q tools/progress_dashboard.py tests/test_progress_dashboard.py-> OKpython3 -I scripts/check_no_game_data.py tools/progress_dashboard.py tests/test_progress_dashboard.py-> OKpython3 -I tests/test_ci_registration.py-> 15/15 OKpython3 -I tests/test_text_write_line_endings.py-> 3/3 OKChecklist