fix(tools): reject a sanitizer report that lists a test twice #12226
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12226"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T03:58:28Z.
What
sanitizer_report.results()stored each JUnittestcasein a dict keyed by its name, so when a report listed the same test twice the later entry silently replaced the earlier one. A report withfiberfailing and thenfiberpassing was summarized as1 tests: 1 passed, 0 skipped, 0 failed.and exited 0, so the nightly Sanitizers job could hide a real failure. The order also mattered: with the two entries swapped the same data counted as failed.results()now refuses a report that lists a test name more than once, using the existing unreadable-report path (sanitizer_report: <file>: testcase <name> is listed more than once, exit 2, nothing written to stdout or--summary). This also covers atestsuitesroot whose nested suites repeat a name. Reports with unique names are classified as before.Tested
macOS 26.2, Apple M5 (arm64), CMake/Ninja,
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON(Python 3.13). Base:2a81f0969f(upstream/main), head:792c8791f0.Measured on base:
<testsuite><testcase name="a" status="run"><failure/></testcase><testcase name="a" status="run"/></testsuite>printed1 tests: 1 passed, 0 skipped, 0 failed.and returned 0.Real ctest 4.3.1 output:
--repeat until-pass:3and--repeat until-fail:2both write onetestcaseper test (the final attempt only). Duplicates therefore do not appear in reports ctest writes, so this refusal does not affect today's workflow input. It only stops a merged or hand-edited report from hiding a failure.tools/tests/test_sanitizer_report.pytest_a_test_listed_twice_is_rejectedcovers fail-then-pass, pass-then-fail, pass-pass and a duplicate across nestedtestsuites. Each case exits 2 with an empty stdout and leaves--summaryuntouched. Red on base source (4 failures in the new test), green at head, 22/22. Full relinker ctest 366/366.check_conventions.py --base upstream/mainPASS.pr_overlap.py --branch fix/sanitizer-report-duplicate-testsclean (#12096 touchesmain(), a disjoint hunk; it merges cleanly). Host-only tools change. No title, GPU or console involved.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)pr_overlapclean)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T04:01:45Z.
Review: APPROVED
I reviewed the exact head and ran
python3 -m unittest tools.tests.test_sanitizer_report: 22 tests passed.tools/check_conventions.py --base refs/review/main,git diff --checkand a merge preview with currentmainall pass. The duplicate rejection occurs before any summary output or write, and the test covers both orderings, duplicate passes and duplicates across nested suites. No blocking issue found. Hosted conventions, intake and labels pass; the relinker matrix was still pending, and full platform builds are path-skipped for this Python-only change.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T04:29:37Z.
Review: APPROVED
Reviewed
792c8791f0fb1487b64ce519788df5d0afde1f83— approve. Duplicate JUnit testcase names are rejected rather than letting a later pass hide an earlier failure.Windows/Python 3.11: head 22 passed (22 total); author base 21 passed (21 total). The new duplicate-order/nested-suite cases distinguish old production, and the complete head suite passes. The refusal is for merged or hand-edited reports; ordinary unique-name CTest output is retained. No nightly sanitizer run was performed locally.
The inspected hosted Windows relinker job merged this exact head and completed successfully. This is not a full product or game build.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:02:07Z.
Review: APPROVED
Rejecting a duplicate testcase name prevents the dict from silently discarding one result and hiding a failure, regardless of ordering or whether duplicate names are in nested suites. The tests cover fail/pass orderings, duplicate passes, nested suites, and the no-summary-on-error behavior; the report notes that normal CTest output does not use duplicate entries. Current relinker/ASan and conventions checks pass. No blocking issue found.