Skip to content

test(sandbox): run the signal-killed probe test on Windows - #22917

Merged
mbriones98 merged 2 commits into
mainfrom
fix/22675-probe-signal-windows
Oct 22, 2026
Merged

mbriones98 merged 2 commits into
mainfrom
fix/22675-probe-signal-windows

Conversation

@mbriones98

@mbriones98 mbriones98 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Stop test_probe_child_killed_by_signal_is_transient from 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

  • Making the namespace probe itself work on Windows. Production never reaches it off Linux.
  • Changing any product code.

What changed (motivation → approach → change)

  • Symptom: the worker crashed during a strict xfail on Windows.
  • Root cause: the test drives the fork probe, which touches os.fork, os.getuid/getgid, os.WNOHANG, the POSIX wait-status macros and select.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.
  • Change: the test supplies POSIX stand-ins for exactly those names, through monkeypatch with raising=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_transient now 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

  • Linux: test/test_sandbox_backend_cache.py passed 45/45 on each of 5 runs. The single test passed 30/30. test_sandbox_probe.py, test_leaf_test_scope.py and test_windows_gap_list.py passed 110/110.
  • Simulated Windows: I removed os.fork, getuid, getgid, WNOHANG, the wait-status macros, select.poll and POLLIN, then ran the test body. The new version passes. The previous version fails on the missing os.fork.
  • Not verified locally: a real Windows run. In particular, a read on a Windows pipe whose write end is closed should return EOF, and the probe handles an OSError from 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

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

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
@mbriones98
mbriones98 requested review from a team and KiroCrewCaptain as code owners October 21, 2026 21:54
@mbriones98
mbriones98 enabled auto-merge (squash) October 21, 2026 21:54
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of c7d72aa8da8dd6c527047b7edf4af0abede9b675 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (3 items) — 3 justified

Intent: 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 4533b1eb (#22883 and earlier), not this head, so they are not judged here.

  1. The signal-killed probe test runs and must pass on Windows, where it used to be a strict xfail — justified
  2. The test supplies its own POSIX stand-ins (fork, uid/gid, wait-status macros, select.poll), and only where the platform lacks them — justified
  3. The test's line is removed from test/windows-expected-failures.txt — justified

[FIRST-PRINCIPLES-REVIEWED] c7d72aa

Description read

[DESCRIPTION-READ] f0af886bda1b91d95931555690a1ccad758b05fd9d8c2ba10f3a734363f79ef3

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of c7d72aa8da8dd6c527047b7edf4af0abede9b675 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of c7d72aa8da8dd6c527047b7edf4af0abede9b675 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • If more fork-probe tests need these Windows stand-ins later, move _provide_posix_probe_apis into a shared fixture so each test file doesn't grow its own copy.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed c7d72aa8da8dd6c527047b7edf4af0abede9b675 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] c7d72aa

Verdict parsed from the review's SHA-scoped output markers for commit c7d72aa8da8dd6c527047b7edf4af0abede9b675.

False positive or not applicable? A repository writer can comment:
/ai-review override fable c7d72aa8da8dd6c527047b7edf4af0abede9b675: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of c7d72aa8da8dd6c527047b7edf4af0abede9b675 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] c7d72aa

False positive or not applicable? A repository writer can comment:
/ai-review override gpt c7d72aa8da8dd6c527047b7edf4af0abede9b675: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 21, 2026
… 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.
@mbriones98 mbriones98 changed the title test(sandbox): skip the signal-killed fork-probe test on Windows test(sandbox): run the signal-killed probe test on Windows Oct 21, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 21, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mbriones98
mbriones98 merged commit 6725e8c into main Oct 22, 2026
106 of 114 checks passed
@mbriones98
mbriones98 deleted the fix/22675-probe-signal-windows branch October 22, 2026 00:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: test_probe_child_killed_by_signal_is_transient times out and crashes its worker on Windows

2 participants