Repository navigation
test(sandbox): run the signal-killed probe test on Windows - #22917
Conversation
test_probe_child_killed_by_signal_is_transient drives the fork-based namespace probe, which needs os.fork, os.getuid, select.poll and a POSIX wait status. None of those exist on Windows and production never reaches the probe off Linux, so the test was listed in windows-expected-failures.txt and ran there as a strict xfail. That list's header says a test that can run long must not be listed: on Windows pytest-timeout has no SIGALRM, so a timeout kills the xdist worker instead of failing the test. The per-test timeout fired while pytest was still building this expected failure's report, and the worker crashed. Give the test an explicit Windows skipif with the reason, matching the sibling fork-probe tests in test_sandbox_probe.py, and delete its line from the list. Linux and macOS runs are unchanged. Fixes #22675
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Only test files change, the defect has a linked issue (#22675), and deleting the list line is what the list's own header asks for: "Fix the test … and DELETE the line". What this change shipsInventory (3 items) — 3 justifiedIntent: stop one sandbox probe test from crashing a Windows backend-test worker. This is a FIX. The patch file also carries pi Node-floor, RFC, Papyrus and prepare-pr hunks. Those are already on the base
[FIRST-PRINCIPLES-REVIEWED] c7d72aa Description read[DESCRIPTION-READ] f0af886bda1b91d95931555690a1ccad758b05fd9d8c2ba10f3a734363f79ef3 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff only changes tests, so it adds or changes no user-visible control and needs no screenshot. [UX-REVIEWED] c7d72aa Description read[DESCRIPTION-READ] 180eac059b5c9973bcb0f92c26badccd4a98231a657248f8d885dbd7afde98aa That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change touches only tests, the deleted xfail line belongs to the test that now runs, and the Backend Tests (Windows) CI job exercises the Windows path. Notes
[DESIGN-REVIEWED] c7d72aa Description read[DESCRIPTION-READ] 4f3a4f364db1d87210f696ec0d4913ceefcfe86bc4b9d8de5f4fc537858af246 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
… skipping Replace the Windows skip with stand-ins for the POSIX names the fork probe touches (os.fork, os.getuid/getgid, os.WNOHANG, the wait-status macros and select.poll). Each is added only where the platform lacks it, so Linux and macOS run unchanged, and Windows now runs the same assertions on the parent's verdict logic rather than skipping or carrying an xfail. The test no longer depends on a missing attribute raising inside the probe, so on Windows it passes quickly and the strict-xfail path whose report outlived the per-test timeout is gone.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only change: the signal-killed probe test supplies missing POSIX names so it runs on Windows, and drops it from the Windows expected-failures list.
Problem / Motivation
Goal: Stop
test_probe_child_killed_by_signal_is_transientfrom crashing a Windows backend-test worker.On Windows the test sat in
test/windows-expected-failures.txt, so it ran there as a strict xfail. The per-test timeout fired while pytest was still building the expected failure's report. Windows pytest-timeout has no SIGALRM, so it killed the xdist worker (gw3) instead of failing the test, and the shard lost the worker.Why it matters
A crashed worker fails the whole Backend Tests (Windows) shard, on PRs that never touch the sandbox (it happened on a frontend-only PR). That blocks unrelated merges until someone reruns the shard.
Not a goal
What changed (motivation → approach → change)
os.fork,os.getuid/getgid,os.WNOHANG, the POSIX wait-status macros andselect.poll. Windows has none of these, so the test failed on a missing attribute. The list header itself says such an entry must not stay listed, because a slow xfail report kills the worker.monkeypatchwithraising=False, and only where the platform lacks them. Linux and macOS replace nothing. Windows now runs the same assertions against the parent's verdict logic and passes. The list line is deleted. An interim Windows skip in the first commit was replaced, so nothing new is skipped.Backwards compatibility
Compatible: only test files change.
Removes nothing: the deleted line was a Windows xfail marker for a test that now passes on Windows. Leaving it would turn that pass into a strict XPASS failure.
Tests
test/test_sandbox_backend_cache.py::test_probe_child_killed_by_signal_is_transientnow runs on every platform. It asserts that a probe child killed by signal 9 is reported as transient, with "signal 9" in the reason.Manual verification
test/test_sandbox_backend_cache.pypassed 45/45 on each of 5 runs. The single test passed 30/30.test_sandbox_probe.py,test_leaf_test_scope.pyandtest_windows_gap_list.pypassed 110/110.os.fork,getuid,getgid,WNOHANG, the wait-status macros,select.pollandPOLLIN, then ran the test body. The new version passes. The previous version fails on the missingos.fork.OSErrorfrom that read the same way. The Backend Tests (Windows) jobs on this PR are the real check.Related Issues
Fixes #22675
Pattern harvest
Rule candidate: review-prompt
Pattern: a POSIX-only test placed on the Windows strict-xfail list fails on a missing attribute, and the slow xfail report can outlive the per-test timeout. Supply missing POSIX names with
monkeypatch.setattr(..., raising=False)so the test runs on Windows, rather than listing or skipping it.Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.