Skip to content

fix(tests): the pause test raced the deferred launch and blocked the deploy (v0.446.1) - #827

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/pause-test-race
Sep 17, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/pause-test-race

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What happened

make-live.sh refused to restart anything after v0.446.0: session-pause-test.cjs failed its last assertion on instawp and passed on expresstech. The gate was right — but the failure was in the test, not the feature.

The HTTP section asserted the row read running after unpause. launchAgentRuntime stamps launching synchronously and hands the real launch to a setImmediate whose .catch stamps the row crashed — and that deferred half does far more than the stubbed backend.spawn (env files, skills, credentials). On a box where any of it throws, the status flips between the await and the read.

A test that passes on one box and fails on another for timing reasons is the worst shape a test can have, so this removes the race rather than widening the assertion.

Fix

  • Stub launchAgentRuntimeNow in that section. It is about the route and the status transition; the launcher has its own tests, and the section already stubs every other backend call.
  • Both status assertions now pass the value they actually found into the failure detail, so the next failure is diagnosable from the deploy log alone instead of needing an ssh round trip.

Also checked

The same deploy showed warm-chat-test failing once on expresstech. It passes 5/5 standalone there and the full suite now passes end to end on that box (EXIT=0), so that one was a flake under suite load, not a regression — noted rather than papered over.

Testing

npm run test:governance green locally; verified on instawp (the box that reproduced it) before merge.

🤖 Generated with Claude Code

…deploy (v0.446.1)

`session-pause-test.cjs`'s HTTP section asserted the row read `running` after unpause. But
`launchAgentRuntime` stamps `launching` synchronously and hands the real work to a `setImmediate` whose
`.catch` stamps the row `crashed` — and that deferred half does far more than the stubbed
`backend.spawn` (env files, skills, credentials). On a box where any of it throws, the status flipped
between the `await` and the read.

Live: instawp failed `the row is running again`, expresstech passed it — the worst shape a test can
have. `make-live.sh` gated correctly and restarted nothing.

The section stubs `launchAgentRuntimeNow`: it is about the ROUTE and the status transition, and the
launcher has its own tests. Both status assertions now report the value they actually found, so the next
failure is diagnosable from the log alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit 56b7e42 into main Sep 17, 2026
1 check passed
@vikasprogrammer
vikasprogrammer deleted the feat/pause-test-race branch September 17, 2026 11:17
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.

1 participant