Skip to content

Windows: run the native-type tests on Windows, and fix the two that could not - #10624

Merged
danielhanchen merged 1 commit into
mainfrom
fix/windows-native-type-tests
Sep 9, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/windows-native-type-tests

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #10540.

What is wrong

Two of the tests #10540 added only pass on POSIX. Nothing in CI noticed, because the Windows row of cross-platform-parity-ci.yml does not run tests/python/test_windows_installer_native_type_fallback.py at all. Run on a real windows-latest runner, twelve cases fail.

The retry test never reached the code it measures

test_only_a_probe_that_never_answered_is_retried stubs the child probe but not the Device Guard query. On Linux that query fails, so the gate falls through to the probe and the stub is what answers. On Windows the query succeeds and reports status 0, which is the "no policy" shortcut, so the gate returns true and the stub is never called. The test then reads a true it did not ask for.

It now stubs the query as well, reporting an active policy, which is what the two active-policy tests immediately above it already do. The case under test is reached on either host.

The fake host is a shell script

test_the_probe_only_accepts_a_clean_exact_answer and test_a_child_that_never_returns_does_not_hang_the_installer write a #!/bin/sh file and hand it to Process.Start as a stand-in for the PowerShell host, which is how the acceptance rules get exercised without a policy or a Windows box.

Windows cannot execute a file with no executable format. Every case comes back false through the catch, so the accept case fails outright, and the deadline case passes in milliseconds without ever exercising the deadline. The second of those is the worse outcome: a green result that measured nothing.

Both are marked POSIX only, with the reason in the test, since what they measure is host-independent PowerShell logic and the Windows behaviour of the same code is covered by the production path.

So that this cannot happen again quietly

The file joins the Windows parity row. The next test in it that only works on one platform fails in CI instead of waiting to be found by hand.

Verification

tests/python/test_cross_platform_parity.py, test_windows_python_venv_hardening.py, test_windows_setup_output_encoding.py, test_windows_installer_native_type_fallback.py, test_pwsh_runner_encoding.py and tests/studio/test_workflow_guards_run_unfiltered.py: 308 passed, 8 skipped.

…ould not

Follow-up to #10540. Two of the tests it added only pass on POSIX, and nothing in
CI noticed because the Windows row of cross-platform-parity-ci.yml does not run
that file. On a real windows-latest runner twelve cases fail.

The retry test stubs the child probe but not the Device Guard query. On Linux that
query fails and the gate falls through to the probe; on Windows it succeeds with
status 0 and the gate returns before the stub is ever called. It now stubs the
query too, the way the active-policy tests next to it already do, so the case under
test is reached on either host.

The acceptance and deadline tests hand a shell script to Process.Start as a stand-in
host. Windows cannot execute a file with no executable format, so every case comes
back false through the catch: the accept case fails outright and the deadline case
passes without ever waiting, which is worse. Both are marked POSIX only with that
reason, since what they measure is host-independent PowerShell logic.

Then the file joins the Windows parity row, so the next test that only works on one
platform is caught by CI rather than by hand.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T13:23:24.785181Z 2eabd46 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 9, 2026
@danielhanchen
danielhanchen merged commit a73ecae into main Sep 9, 2026
1 of 17 checks passed
@danielhanchen
danielhanchen deleted the fix/windows-native-type-tests branch September 9, 2026 15:27
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