Repository navigation
test(electron): stub the py-spy dump in the gateway supervisor harness - #35635
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The flake comes from the harness running a real [DESIGN-REVIEWED] 467e912 Description read[DESCRIPTION-READ] 3f6e17c1bcceaff3297ec6f2fc50d51ed39d90f5b6dc82e4eab12fb51daf19b2 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff only changes Electron test harness files, so there is no user-visible surface and no screenshots are needed. [UX-REVIEWED] 467e912 Description read[DESCRIPTION-READ] e6092d80f7b7c18705accacbbbe64ed8b300e6cd65b2231b2cb76d8002e6aa12 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 |
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: |
Code change approver recommendation: ApproveWhy: the decider estimates a 5% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. Test-only change: the shared gateway-supervisor harness now defaults capturePySpyDumpFn to a stub that resolves at once, so wedge recovery no longer spawns a real An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
Backend Tests (Windows) shards 2 and 4 are red on main, not on this diff (this PR changes only two electron test files). Both reproduce on main's tree at e8283ce:
|
9d657f8 to
467e912
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed at 467e912. I read the whole diff.
Test-only. The gateway supervisor test harness now defaults capturePySpyDumpFn to a stub that answers { ok: false, reason: "py-spy does not run in this harness" }. A test can still pass its own through overrides.capturePySpyDumpFn. So no test spawns the real py-spy, whose exit lands after a host-dependent number of loop turns. The wedge-unlisted-owner test's header now lists the stack dump among what it scripts.
No product code changes. 98 checks green.
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 electron gateway supervisor test harness now stubs the py-spy dump by default, and one test file header comment is updated.
Problem / Motivation
Goal:
gateway-supervisor.wedge-unlisted-owner.test.jsgives the same verdict on every host, so its red means a real recovery bug.On a host with
py-spyinstalled, the file failed 10 of 10 solo runs onmain, on Node 22 and Node 24. Each run a different subset of the respawn and port-wait tests went red, for examplethe gateway is respawned once: 0 !== 1. The full electronnpm testshowed 1-3 reds per run, always from this file.Why it matters
Anyone running the electron suite on a machine with
py-spy(a normal setup for a Kiro Crew developer) gets red runs that have nothing to do with their change. That trains people to rerun and ignore this file, which hides a real regression in wedge recovery when one lands.Not a goal
settle()drains the scripted clock.What changed (motivation → approach → change)
settle()returns before recovery reaches the port check, so no timer fires and no respawn is countedcapturePySpyDump. The harness never scripted it, so the test ran the realpy-spy dump --pid 1234, a real child processharness()ingateway-supervisor-test-helpers.jsnow defaultscapturePySpyDumpFnto a stub that resolves at onceThe real bind check was the first suspect. It is not the cause: at every early return of
settle(), no real socket was mid-listen or mid-close, and recovery's last log line was the one before the dump. Withoutpy-spyon the host (CI), the spawn fails withENOENTwithin the same few loop turns, which is why CI stayed green.With no real process left before the port check,
settle()'s fixed drain is enough, so it is unchanged. The harness already refused a realexecFile; the dump reached the host only because it calls its ownexecFile. The file's header now names the dump as scripted. As a side effect the file runs in about 0.6 s instead of about 120 s.Backwards compatibility
Compatible: test-only change; a test that passes its own
capturePySpyDumpFnstill gets it.Removes nothing: the harness only gains a default for an option nobody else reads.
Tests
Proof: not provable -- test-only change
Determinism proof, on this host (load average 13-24, 48 cores):
HOMEwith apy-spythat exits after 200 msnpm testEach of the five issue tests still fails when the behaviour it asserts is removed from
gateway-supervisor.js:respawn-owner.js, and the one instartGateway): "stops the respawn" goes red too. Any single guard alone still stops the spawn.Manual verification
N/A — test-only change; the runs above are the verification.
Related Issues
Closes #35503
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)