Skip to content

fix: preserve CTest verdicts with invalid durations - #5214

Open
nanyoudegege wants to merge 3 commits into
ItsNotRexed:mainfrom
nanyoudegege:fix/ctest-lasttest-duration
Open

nanyoudegege wants to merge 3 commits into
ItsNotRexed:mainfrom
nanyoudegege:fix/ctest-lasttest-duration

Conversation

@nanyoudegege

Copy link
Copy Markdown

Claimed in the coordination issue as: CTest duration handling, #5156.

What and why

parse_lasttest() now treats malformed or nonfinite CTest durations as unavailable without dropping the verdict or later test rows. Valid durations, including zero, are unchanged. This is separate from #5091 (JUnit durations) and #4184/#4194 (CTest verdict reasons).

Tested

  • Cloud Linux, CPython 3.12, CPU only; no GPU or driver used.
  • Ran two focused test methods against the exact isolated parser before and after the patch. The new regression reproduced a ValueError and a strict JSON failure for Infinity on base 3faac557. Both tests pass after the change, including all five new subcases.
  • git apply --check, git diff --check, and Python syntax checks passed. The full dashboard suite was not run.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption, including in logs or reports.
  • No translator rule changed.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 742780e on Windows 11, CPython 3.14.7, CPU only: pass. AI-assisted.

py -3.14 -I -B tests/test_progress_dashboard.py passed all 27 dashboard tests. A synthetic CTest log gave the first test a duration of a single period. The parser kept its failure verdict and returned no duration. It also kept the next two verdicts and their durations: skipped at 0 seconds and passed at 2.75 seconds.

I ran the same 27 tests against merge base 3faac55. Two subcases failed. The parser raised ValueError for 1.2.3. Strict JSON output rejected the infinite duration from the 400-digit input.

@markankamaransheogarat-sys

Copy link
Copy Markdown
Contributor

Independent CPU review at 742780e3 (AI-assisted):

Code inspection:

  • tools/progress_dashboard.py: parse_lasttest now guards float(m.group(1)) against ValueError (e.g., 1.2.3) and non-finite results via math.isfinite(secs) (e.g., huge digit strings overflowing to inf), falling back to secs = None instead of crashing or emitting non-JSON-safe floats.
  • tests/test_progress_dashboard.py: test_lasttest_duration_does_not_hide_verdicts covers malformed, overflow, garbage, missing, and 0.00 durations, and asserts json.dumps(rows, allow_nan=False) succeeds.

Checks run on Linux CPU:

  • python3 -m compileall -q tools/progress_dashboard.py tests/test_progress_dashboard.py -> passed.
  • python3 -I tests/test_progress_dashboard.py -v -> Ran 27 tests in 0.416s -> OK.

Looks good to merge.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 742780e30 on Windows 11: pytest tests/test_progress_dashboard.py -q -> 27 passed, 11 subtests passed; git diff --check clean.

A malformed or non-finite CTest duration is now kept out of the totals with a verdict still attached, rather than dropping the test's pass/fail along with the bad number; the added cases cover malformed, non-finite and ordinary durations. No blocking issue.

Sequence note: merges cleanly with #5210 (git merge-tree exit 0); different inputs, same files.

@Atomic258

Copy link
Copy Markdown
Contributor

Independent check — PASS (coverage): test_progress_dashboard.py 27/27 at head. Note: parent progress_dashboard.py also passes all 27 — the malformed/nonfinite-duration handling already exists; this pins it in tests. AI-assisted (Devin); no game files.

@nanyoudegege
nanyoudegege marked this pull request as ready for review November 23, 2026 09:34
@Atomic258

Copy link
Copy Markdown
Contributor

Tested 742780e on Windows Server 2022, CPython 3.13.12: pass

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@kacper-serewis kacper-serewis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted Windows CPU review at 742780e using a CTest 4.3.3 log. With malformed, overflowing or nonnumeric duration text, the pass survived with unknown duration and the next failure retained 0.02 seconds; 0.00 remained zero. Both adjacent verdict-reason changes recovered the regex skip in this log. One #4184 integration case remains: with captured output and the Test time line entirely missing after , its parser can consume subsequent verdicts as output. The #5214 duration guard itself passed. Checked parsed data through strict JSON; the full dashboard was not run.

Resolve the test insertion conflict by retaining both upstream captured-output regressions and the invalid-duration regression. Linux CPU: 39 dashboard tests passed, including CLI checks. No game data. AI-assisted.
@JRamos1993

Copy link
Copy Markdown
Contributor

Tested cc2fae84 merged onto main 8575d36e on Windows 11, CPython 3.14.3, CPU only: pass.

  • python -I tests/test_progress_dashboard.py: 40 tests OK.
  • Negative control (tools/progress_dashboard.py from main, the PR's tests kept): tests/test_progress_dashboard.py 40 tests FAILED (errors=2).
  • py_compile on the 2 changed Python files: OK; git diff --check: clean.

No game files. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested cc2fae8 merged with main 00f5ce6 on Linux (WSL2), CPython 3.12.16, CPU only: pass. The merge was clean (tools/progress_dashboard.py and tests/test_progress_dashboard.py merged automatically); python -I tests/test_progress_dashboard.py ran 41 tests, OK. Negative control: with tools/progress_dashboard.py reverted to main's version the same test file fails (2 errors), and passes again once restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants