Repository navigation
Windows: run the native-type tests on Windows, and fix the two that could not - #10624
Merged
Merged
Conversation
…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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymldoes not runtests/python/test_windows_installer_native_type_fallback.pyat all. Run on a realwindows-latestrunner, twelve cases fail.The retry test never reached the code it measures
test_only_a_probe_that_never_answered_is_retriedstubs 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_answerandtest_a_child_that_never_returns_does_not_hang_the_installerwrite a#!/bin/shfile and hand it toProcess.Startas 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.pyandtests/studio/test_workflow_guards_run_unfiltered.py: 308 passed, 8 skipped.