Skip to content

test(windows): burn down the gateway-run xfails by patching the rlimit seam - #23781

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-gateway-run-xfails
Oct 30, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-gateway-run-xfails

Conversation

@leonlaiyc

@leonlaiyc leonlaiyc commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the eight gateway-run tests that are strict xfails on Windows because they patch a POSIX-only module run and pass on the Windows matrix.

All eight test/test_slack_gateway_run.py entries in test/windows-expected-failures.txt fail on Windows before the test does anything:

ModuleNotFoundError: No module named 'resource'

Each test runs GatewayOrchestrator.run() inside patch("resource.getrlimit", return_value=(256, 10240)) and patch("resource.setrlimit"). resource exists only on POSIX, so patch cannot import its target on Windows. The gateway itself never touches resource: it calls platform_compat.raise_nofile_soft_limit(10240) (slack/gateway_runtime/service_boot.py), and platform_compat_runtime imports resource only on POSIX. No test asserts on the two mocks; they only keep the run from raising the open-file limit.

Why it matters

A strict xfail runs and asserts nothing anyone reads, so these eight checks of the gateway's run, shutdown, run-marker and background-session paths cover nothing on Windows, where the gateway does run.

Not a goal

  • The open-file limit itself, or how raise_nofile_soft_limit behaves on any platform.
  • Other entries in the list that patch POSIX-only names (os.killpg, os.getuid, fcntl): their product paths differ by platform, so each needs its own fix.

What changed (motivation → approach → change)

  • Symptom: ModuleNotFoundError: No module named 'resource' from patch on Windows.
  • Root cause: the tests patch the POSIX-only module instead of the seam the gateway calls.
  • Change: each resource.getrlimit / resource.setrlimit pair becomes one patch("kiro_crew.platform_compat.raise_nofile_soft_limit"), the facade name service_boot.py resolves at call time, and the body inside it moves up one level, unchanged. On POSIX the run still does not touch the real limit.
  • The eight strict-xfail lines are gone from test/windows-expected-failures.txt.
  • Rebased 2026-10-29: since this PR opened, main added TestRunFreezesBootHeap with two more tests that patch the same resource pair (and two more list lines). They get the same one-line seam patch and their lines go too, so the diff now removes ten lines. Leaving them would keep the same root cause on the list.

Backwards compatibility

Compatible: test-only; no product code changes.

Removes nothing: eight strict-xfail lines go, so these tests now run and assert on Windows, and no assertion is dropped.

Tests

  • test/test_slack_gateway_run.py and test/test_windows_gap_list.py on a Windows host, with the lines removed: 22 passed on Python 3.13.5 and on 3.12.13. test_slack_gateway_run.py alone after black: 17 passed.
  • After the rebase onto main d4583f28a4, on this Windows host (Python 3.13) with --runxfail: main's test_slack_gateway_run.py gives 10 failed, 17 passed (No module named 'resource'); this branch gives 27 passed. test_flake_pattern_ratchet.py + test_ci_surface_tests.py: 138 passed; black and flake8 clean.
  • test/test_flake_pattern_ratchet.py and test/test_wait_discipline_ratchet.py: 113 passed (the bodies moved one level are the same statements, so the per-file counts are unchanged).
  • black, flake8, check_comment_history, and a trial merge with test(chat-slack): give weak tests real checks and merge twin cases #23743 and fix(instances): mint through the data home the run-dir pointer names #23444 (the open PRs touching this file) and with test(windows): burn down six path-separator xfails #23777 (the other list edit): all clean.

Proof: not provable -- test-only change

Manual verification

N/A — test-only change; the Windows run above is the check, and the Windows matrix runs these tests on this PR.

Related Issues

Fixes #23778

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

🤖 Generated with Claude Code

@leonlaiyc

Copy link
Copy Markdown
Contributor Author

CI on e407536bfb is red for an infrastructure reason, not a verdict on the code.

  • Fast Gate run 40112809320: six light jobs (Vendored Tree Integrity, Brand Name Gate, Loop-Bound Locks Gate, Testpaths Coverage Gate, Working-Directory Path Gate, Memory Store Seam Gate) started at 17:01 UTC and were cancelled at the 10-minute job ceiling with no log uploaded, so the run ended cancelled.
  • CI run 40112809341: Await Fast Gate failed closed ("Fast Gate still 'in_progress' after 727s ... This is not a verdict on the code: re-run this job once that run completes"), and Coverage Gate failed closed behind it.
  • Fast Gate never completed, so none of the fork AI-review lanes has run for this head.

A fork cannot re-run workflows. Could a maintainer re-run Fast Gate run 40112809320, then CI run 40112809341? Jobs that started in the same minute on #23788 stalled the same way.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 27, 2026
…t seam

Ten gateway run tests patched resource.getrlimit and resource.setrlimit
to keep orch.run() from touching the open-file limit. resource is a
POSIX-only module, so on Windows each patch raised ModuleNotFoundError
before the test ran. The gateway reaches the limit only through
platform_compat.raise_nofile_soft_limit (service_boot.py), which is
the seam to patch: one patch of the facade replaces each pair, and the
ten strict-xfail lines go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leonlaiyc
leonlaiyc force-pushed the claude/windows-gateway-run-xfails branch from e407536 to 97908a2 Compare October 30, 2026 02:22
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 97908a23cd40d15debac289673988fed7ed09dd7 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ⏭️ skipped

Revision 97908a23cd40d15debac289673988fed7ed09dd7 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 97908a23cd40d15debac289673988fed7ed09dd7 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the tests now patch the seam the gateway actually calls (service_boot.py:734 looks up platform_compat.raise_nofile_soft_limit each time it runs), and the gap list loses only lines whose cause is gone.

[DESIGN-REVIEWED] 97908a2

Description read

[DESCRIPTION-READ] 03363b6619aa7b61c46d5a1b5ee65754dc9594091c5078ab23a1f89ed27333ac

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 97908a23cd40d15debac289673988fed7ed09dd7 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 97908a2

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 97908a23cd40d15debac289673988fed7ed09dd7 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 97908a2

@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 30, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 30, 2026 05:05

@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 gateway-run tests patch the raise_nofile_soft_limit seam instead of resource.getrlimit/setrlimit, and the matching Windows expected-failure entries are removed.

@KiroCrewCaptain
KiroCrewCaptain merged commit bf241a3 into kirodotdev:main Oct 30, 2026
99 of 107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway-run tests patch the POSIX-only resource module, so all eight are Windows xfails

2 participants