fix: propagate the serial test runner's exit code on Windows - #4771
Open
MohammedAlkindi wants to merge 1 commit into
Open
fix: propagate the serial test runner's exit code on Windows#4771MohammedAlkindi wants to merge 1 commit into
MohammedAlkindi wants to merge 1 commit into
Conversation
run_serial_tests.py ends in os.execv. Windows has no process replacement, so the CRT spawns a child and terminates the caller with 0. make tests-serial returns in about 100 ms reporting success while pytest keeps running orphaned, and its output arrives afterwards, interleaved into whatever the shell runs next. run_integration_tests.py already handles this at lines 103-106, added in 21a1f9b. Apply the same win32-guarded shape here: subprocess.run with check=False, then raise SystemExit on the child's return code. POSIX is unchanged. os.execv still runs there, so pytest keeps owning the terminal and its own signal handling. Adds two tests mirroring the precedent's test_windows_bootstrap_uses_subprocess_and_propagates_exit_code: the win32 case asserts the code propagates, that check is False, and that os.execv is never called; the POSIX case asserts execv is still used and subprocess.run is not.
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.
make tests-serialexits 0 on Windows whether the serial tests pass or fail..github/scripts/run_serial_tests.pyends inos.execv. Windows has no process replacement: theCRT spawns a child and terminates the caller with 0. The caller returns in about 100 ms while pytest
keeps running orphaned, so
make testsandmake checkreport success, and pytest's output arrivesafterwards, interleaved into whatever runs next.
AGENTS.mdlistsmake testsin the mandatorylocal run order.
run_integration_tests.pyalready handles this at lines 103-106, added in21a1f9b4. This appliesthe same guarded shape to the serial runner, plus a unit test mirroring
test_windows_bootstrap_uses_subprocess_and_propagates_exit_code.POSIX is unchanged:
os.execvstill runs there, so pytest keeps owning the terminal and its ownsignal handling.
CI is unaffected.
make testsruns onubuntu-latest, and thewindows-latestjob invokesuv run pytestdirectly, so serial tests already propagate there.verification