Repository navigation
🍒 [1.7] test(cloudxr): poll the run-flags cmdline read in test_background.py - #1453
Merged
Merged
Conversation
…1376) * test(cloudxr): poll the run-flags cmdline read in test_background.py Popen() can return while the child is still mid-exec, when its /proc/<pid>/cmdline reads empty. test_reads_real_cmdline_without_a_trailing_empty read the run flags at once and failed with `assert [] == ['--host-client']`. Replace the per-reader read_pid() poll with _await_exec(), which waits for the child's cmdline itself and fails clearly after 5s. Every test that reads a just-spawned child's cmdline now calls it first, including the two that expect no match: an empty cmdline made those pass without testing anything. Signed-off-by: Ivan Yang <yifanyang@nvidia.com> * test(cloudxr): wait for the child's own argv, not just a non-empty cmdline On the posix_spawn path the child shares our memory until exec swaps it, so /proc/<pid>/cmdline can briefly read pytest's own argv. _await_exec then returned at once, and the next read could still miss the service. CPython 3.13 takes that path by default where os.POSIX_SPAWN_CLOSEFROM exists; uv's managed builds lack it, so CI is unaffected. Forced onto posix_spawn, the previous helper failed 7 of 10,000 runs of the cmdline tests; this one failed none. Signed-off-by: Ivan Yang <yifanyang@nvidia.com> --------- Signed-off-by: Ivan Yang <yifanyang@nvidia.com> (cherry picked from commit ce2d32f)
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
nv-jakob
approved these changes
Nov 9, 2026
This branch was successfully deployed
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.
Description
Cherry-pick of #1376 onto
release/1.7.x.cloudxr_test_backgroundfailed intermittently because a just-spawned child's/proc/<pid>/cmdlinecan read empty or still show the parent's argv; the tests now wait for the child's own argv before reading it.Type of change
Testing
git cherry-pick -xontorelease/1.7.x; the patch is identical to the merged commit onmain.SKIP=check-copyright-year pre-commit run --all-filespasses.test_background.pyagainst this branch'sbackground.py: the cmdline tests passed 200 repeats. The full CTest run is this PR's CI.No new test: this is the test fix itself.
Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCO