Skip to content

Write the flaky report's output as UTF-8 on every runner - #601

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-report-utf8
Oct 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-report-utf8

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Refs #583

Summary

On a Windows runner Python writes stdout as cp1252, so scripts/ci-flaky-report.py raised UnicodeEncodeError when it printed a test name with a character outside that code page.
In nightly run 37391023049 (shard 2/4) it filed #583 for "⌘D splits the focused pane ...", then raised on print(f"filed {url} for {name}").
The error is a ValueError, so main caught it as a failed filing: the run warned that 1 flaky test was not filed (it was), and any later flaky test in that run would have been skipped.
The script now sets its stdout to UTF-8 when it runs as a script, which is what the Actions log reads on every runner.

Review

  • 조심해서 볼 파일: scripts/ci-flaky-report.py - the change is in the __main__ block only, so main() called from the unit tests keeps the test runner's stdout.

Evidence

  • 확인한 것: the new test runs the script with PYTHONIOENCODING=cp1252 and a fake gh on a report whose flaky test is named "⌘D splits the pane"; without the fix it fails with the same message as the CI run ('charmap' codec can't encode character '⌘'), with it the script exits 0 and prints the name.
  • 확인한 것: python3 -m unittest scripts.tests.test_ci_flaky_report 18 pass.
  • 확인하지 못한 것: a real Windows runner printing a ⌘ name; that happens only when such a test is flaky again. The full unittest discover suite was left to the policy lane.

A Windows runner writes Python's stdout as cp1252, so printing a test name
with a character outside it (the ⌘ in a shortcut test) raised right after
the issue was filed; the run then warned that nothing was filed and skipped
the rest of its flaky tests.
@yansfil
yansfil merged commit 8694544 into main Oct 6, 2026
19 checks passed
@yansfil
yansfil deleted the fix/flaky-report-utf8 branch October 6, 2026 04:11
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.

1 participant