mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-23 04:54:00 +01:00
test(runner): stop two CI-contention flakes that starve the canary lane (#13418)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Each master commit is published as an npm canary, and the nightly release gate installs the newest canary and runs the onboarding smoke against it > - A canary only publishes after the Cloud readiness workflow passes for that exact commit > - Cloud readiness fails often, and almost every failure stops that commit from ever becoming a canary > - The nightly gate then keeps testing an old canary, so a fix that landed after it cannot reach the gate, and the gate stays red for reasons no longer in the code > - Most of these failures are short timeouts that only expire because the runner is loaded > - This pull request gives two such timeouts the budget the surrounding tests already use > - The benefit is that more master commits publish a canary, so the nightly gate tests current code ## Linked Issues or Issue Description No existing issue. The problem, in the bug report format: **What happened** Cloud readiness failed on 25 of 85 runs over three days (29%). 24 of those failures stopped the commit from publishing a canary. Two timeout clusters account for 10 of the 25: - `packages/paperclip-runner/src/control-plane/durable-prp-control-plane.test.ts` — `Error: Test timed out in 5000ms.` in "promptly fails the real transport request and notification paths on authenticated bad semantic input". Seen in runs 34652752663, 34654215468, 34656885170, 34657111560, 34661910120. - `packages/paperclip-runner/src/live/live-session.test.ts` — `Turn settled before the intentional SIGKILL: Error: Capability Codex turn timed out after 2000ms`. Seen in runs 34632264036, 34658026290, 34658106386, 34727991195, 34760283177. **Expected behavior** A commit that is good publishes its canary. A test fails because the behavior is wrong, not because the runner was busy. **Steps to reproduce** 1. Run the Cloud readiness workflow on master repeatedly. 2. Watch the Runner protocol and chaos jobs. 3. The two tests above fail intermittently, and the commit then publishes no canary. **Paperclip version or commit** Present on master. Measured over runs from 2026-09-11 to 2026-09-14, which is the workflow's whole history. ## What Changed - `durable-prp-control-plane.test.ts`: the "promptly fails the real transport request..." `it.each` now takes the same 15s budget as the test directly above it. It ran on the 5s default, although it builds a real control plane over a socket. The neighbouring test already asks for 15s, so this reads as an omission. - `live-session.test.ts`: the real-runner SIGKILL test gives the turn a 60s timeout instead of 2s. The test kills the runner process and then asserts the turn was still running at that moment, so the timeout is only a backstop. At 2s a loaded machine settles the turn first and the assertion fails. Neither change weakens an assertion. No test in this PR asserts that a timeout happens, and the tests that do assert one (`turnTimeoutMs: 500` and `turnTimeoutMs: 20`) are untouched. ## Verification ``` cd packages/paperclip-runner npx vitest run src/control-plane/durable-prp-control-plane.test.ts # 87 passed npx vitest run src/control-plane/durable-prp-control-plane.test.ts \ -t "promptly fails the real transport" # 2 passed (both it.each cases) ``` The live-session change is verified by the readiness lane itself, because that suite needs a real runner and a provider. ## Risks Low risk, and limited to test budgets. - A genuine hang in either test now takes longer to report: 15s instead of 5s, and 60s instead of 2s. - A real regression still fails, because the assertions are unchanged. - Timeouts are not a complete fix for this lane. Port races (`EADDRINUSE`), lease races, and lost runner VMs cause about another 40% of its failures. A retry on the `verify` matrix would cover all of those classes, and none of them reproduce on a second attempt. That is a larger policy change, so it is not in this PR. ## Model Used - Claude Fable 5 (`claude-fable-5`), 1M context, extended thinking, run through Claude Code with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes — no documented behavior changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green — pending first run - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups — pending first review - [x] I will address all Greptile and reviewer comments before requesting merge
This commit is contained in:
1 parent
e1d2e279a3
commit
46bcc0863c
2 files changed
+8
-2
No files matched your search
@@ -1714,7 +1714,9 @@ describe.sequential("DurablePrpControlPlane", () => {
|
||||
await core.stop();
|
||||
rmSync(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
15_000,
|
||||
);
|
||||
|
||||
it.each([
|
||||
"semantic_input_digest_mismatch",
|
||||
|
||||
@@ -1831,7 +1831,11 @@ describe("Capability live runnerd and Codex session", () => {
|
||||
...binding,
|
||||
workingDirectory: directory,
|
||||
attemptId: "attempt-real-killed",
|
||||
turnTimeoutMs: 2_000,
|
||||
// The kill below ends this turn, so the timeout is only a backstop.
|
||||
// A short one races a loaded machine and settles the turn first,
|
||||
// which fails the assertion that the turn was still running when the
|
||||
// process died — the flake that starves this lane in CI.
|
||||
turnTimeoutMs: 60_000,
|
||||
});
|
||||
const observed = observeSavedEffect(store, {
|
||||
...binding,
|
||||
|
||||
Reference in new issue
Block a user