Repository navigation
test(cloudxr): fix flaky cmdline-read race in test_background.py - #1209
Merged
Merged
Conversation
test_recognises_a_service_under_any_shipped_module_name intermittently failed with "assert None == <pid>" - background.read_pid() reads /proc/<pid>/cmdline right after Popen() returns, but on a loaded CI runner (e.g. parallel ctest matrix jobs) the child's /proc entry isn't always populated by then. Poll briefly instead of asserting on the first read. Confirmed pre-existing on main (reproduced the same way on commit 6960d4a, unrelated to any in-flight PR); ran the fixed test 5x with no failures. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe service-recognition test now polls Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to No merge-blocking risk is identified in the described test-only change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
gareth-morgan-nv
requested review from
AndreusNvidius,
jiwenc-nv and
sgrizan-nv
October 7, 2026 21:44
sgrizan-nv
approved these changes
Oct 7, 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.
Summary
Fixes an intermittent CI failure in
test_recognises_a_service_under_any_shipped_module_name, which fails withAssertionError: assert None == <pid>roughly 1 in 10 runs.What changed
background.read_pid()reads/proc/<pid>/cmdlineimmediately aftersubprocess.Popen()returns, but on a loaded runner the child's/procentry isn't guaranteed to be populated that instantly.read_pid()for up to 2 seconds instead of asserting on the very first read.Validation
main(commit6960d4a59) and on test(cloudxr): reusable fake-adb test double (FakeAdb/mock_adb) #1147 (which doesn't touchbackground.pyat all).isaaccapture.cloudxr.serviceand legacyisaacteleop.cloudxr.serviceparametrizations roughly evenly — confirms it's a genuine timing race, not specific to either module string.ruff check/ruff format --checkclean.pre-commit run(matching CI'sSKIP=check-copyright-yearhook set) clean.Known limitations / follow-ups
None — this is a minimal, targeted fix to the test's own timing assumption;
background.py's production logic is untouched.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Summary by CodeRabbit