Repository navigation
test(windows): burn down the gateway-run xfails by patching the rlimit seam - #23781
Conversation
|
CI on
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. |
…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>
e407536 to
97908a2
Compare
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the tests now patch the seam the gateway actually calls ( [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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
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 gateway-run tests patch the raise_nofile_soft_limit seam instead of resource.getrlimit/setrlimit, and the matching Windows expected-failure entries are removed.
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.pyentries intest/windows-expected-failures.txtfail on Windows before the test does anything:Each test runs
GatewayOrchestrator.run()insidepatch("resource.getrlimit", return_value=(256, 10240))andpatch("resource.setrlimit").resourceexists only on POSIX, sopatchcannot import its target on Windows. The gateway itself never touchesresource: it callsplatform_compat.raise_nofile_soft_limit(10240)(slack/gateway_runtime/service_boot.py), andplatform_compat_runtimeimportsresourceonly 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
raise_nofile_soft_limitbehaves on any platform.os.killpg,os.getuid,fcntl): their product paths differ by platform, so each needs its own fix.What changed (motivation → approach → change)
ModuleNotFoundError: No module named 'resource'frompatchon Windows.resource.getrlimit/resource.setrlimitpair becomes onepatch("kiro_crew.platform_compat.raise_nofile_soft_limit"), the facade nameservice_boot.pyresolves at call time, and the body inside it moves up one level, unchanged. On POSIX the run still does not touch the real limit.test/windows-expected-failures.txt.TestRunFreezesBootHeapwith two more tests that patch the sameresourcepair (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.pyandtest/test_windows_gap_list.pyon a Windows host, with the lines removed: 22 passed on Python 3.13.5 and on 3.12.13.test_slack_gateway_run.pyalone after black: 17 passed.d4583f28a4, on this Windows host (Python 3.13) with--runxfail: main'stest_slack_gateway_run.pygives 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.pyandtest/test_wait_discipline_ratchet.py: 113 passed (the bodies moved one level are the same statements, so the per-file counts are unchanged).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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code