Repository navigation
ci_expected_failures: accept a UTF-8 BOM in the failed-test list - #8139
KiryaAfimin wants to merge 2 commits into
Conversation
|
Tested Test Suite Execution
Negative Control
Hygiene
AI-assisted review. |
devnull34
left a comment
There was a problem hiding this comment.
Verified via Tier 2 Free Cloud (GitHub Models gpt-4.1) & local review: Streaming lines with enumerate(f) and stripping \ufeff solely on index == 0 eliminates loading entire multimegabyte failure manifests into memory via f.read() while preserving UTF-8 BOM compatibility.
|
Tested 60154de on Windows 11 Pro es-ES (cp1252), CPython 3.14.2, CPU only, no game data: pass. (AI-assisted check, Claude Code.) |
Claimed in the coordination issue as CI failure-list BOM, the second item in that comment.
What and why
Windows PowerShell can save a UTF-8 text file with a byte-order mark. The CI judge included that mark in the first failed test's name. Given a one-line file containing
known, runner status 8, andknownas the expected failure, the judge printed an unexpected-failure error and a notice that the test had passed, then exited 1.Remove one leading U+FEFF from the first decoded line. The judge continues reading line by line and compares subsequent names exactly. The same input now produces one expected-failure warning and exits 0. An unexpected name still exits 1.
Related: #7469 handles invalid UTF-8 in the same reader. This change keeps strict decoding, including for a truncated prefix.
Tested
python -I -B tests/test_ci_expected_failures.pypassed all 13 tests. The CLI regression covers plain UTF-8, a leading BOM on an expected or unexpected name, and U+FEFF on a later line. Three subcases failed with the base reader.git diff --checkand the project's no-game-data scan passed for both changed files.tools/leonida_tui.pyandtools/wave_diff.py.AI-assisted: yes, OpenAI Codex. Synthetic inputs only.