Skip to content

test: fix the remaining Windows test failures - #36

Merged
Amanbig merged 2 commits into
mainfrom
ci/windows-test-fixes
Oct 31, 2026
Merged

Amanbig merged 2 commits into
mainfrom
ci/windows-test-fixes

Conversation

@Amanbig

@Amanbig Amanbig commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Follow-up to #30, which was merged before these last two commits landed. They only change tests; after #30 the Windows jobs had exactly three failures left, all understood from the CI logs:

  1. test_every_slash_command_in_the_dropdown_has_a_handler: read_text() without an encoding uses cp1252 on Windows and cannot decode cli/main.py. Now reads UTF-8
  2. test_trust_declined_then_accepted_then_revoked: the long Windows temp path made rich wrap was \nnot trusted. The output fixture now uses a very wide console, and resets its StringIO properly (truncate(0) without seek(0) padded output with NULs)
  3. test_keyboard_interrupt_kills_the_child_and_propagates: the test patched subprocess.Popen globally, so the taskkill call that run_shell makes during cleanup on Windows was interrupted too and the child was left running. Only the command under test is interrupted now

The process-tree kill itself is verified on Windows by #30's passing test_timeout_* and hooks tests.

Verified locally (Linux, HOME redirected): suite passes. Windows jobs on this PR are the real check.

Read cli/main.py as UTF-8 (cp1252 is the Windows default and cannot decode it),
and use a wide console in the output fixture so a long Windows temp path does
not wrap the sentence being asserted on. Also reset the StringIO properly:
truncate(0) alone left the write position and padded output with NULs.
The test patched subprocess.Popen globally, so the taskkill call run_shell
makes during cleanup on Windows was interrupted too and the child was left
running. Interrupt only the command under test.
@Amanbig
Amanbig merged commit 6706069 into main Oct 31, 2026
13 checks passed
@Amanbig
Amanbig deleted the ci/windows-test-fixes branch October 31, 2026 10:51
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