diff --git a/changelog.d/capy-gst1103-docsync-timing.md b/changelog.d/capy-gst1103-docsync-timing.md index 8bfd4b685..3a04e56ee 100644 --- a/changelog.d/capy-gst1103-docsync-timing.md +++ b/changelog.d/capy-gst1103-docsync-timing.md @@ -1,5 +1,5 @@ **The docsync fault-callback replays and the runShadow deadline test stop failing on loaded remote pregate VMs.** ### Fixed -- **Docsync fault-callback replays** (`test/helpers/docsync-fault-callbacks.ts` and its three wrappers): each replay in the generated child now has a 30 s limit instead of bun's 5 s default, and each wrapper's limit is that per-replay limit times its replay count plus one. A replay spawns 30 to 40 real actor, hook and git processes. That takes about 1.3 s on CI and up to 4.9 s on an idle 4-core machine, and it ran past 5 s on GSTA-234's remote pregate for #3892. With 8 busy loops on 4 cores, main fails all 12 legacy-control replays at 5 s, and this branch passes all 12 (172 s for the whole wrapper). +- **Docsync fault-callback replays** (`test/helpers/docsync-fault-callbacks.ts` and its three wrappers): each replay in the generated child now has a 30 s limit instead of bun's 5 s default, and each wrapper's limit is that per-replay limit times its replay count plus one. A replay spawns 30 to 40 real actor, hook and git processes. That takes about 1.3 s on CI and up to 4.9 s on an idle 4-core machine, and it ran past 5 s on GSTA-234's remote pregate for #3892. With 8 busy loops on 4 cores, main fails all 12 legacy-control replays at 5 s, and this branch passes all 12 (172 s for the whole wrapper). `test/docsync-report-interface.test.ts` gets the same limits: its child cases ran 5.5 s and 11.4 s on #3869's remote pregate. - **`test/autoplan-shadow.test.ts` "one deadline covers the call and its retry"**: the first call now has 1 s of room inside the deadline instead of 300 ms. The time limit allows 2.4 s past the deadline before it would match an unshared retry, up from 0.9 s; the remote failure ran 1.06 s past. The test still requires the retry to be cut (p1 malformed) and the call to end before an unshared retry could finish. diff --git a/test/docsync-report-interface.test.ts b/test/docsync-report-interface.test.ts index 1923a0dbb..821094e80 100644 --- a/test/docsync-report-interface.test.ts +++ b/test/docsync-report-interface.test.ts @@ -2,6 +2,7 @@ import { expect, test } from 'bun:test'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; +import { CALLBACK_TEST_MS, callbackBudgetMs } from './helpers/docsync-fault-callbacks'; test('actual registered documentation callbacks stage the generated report contract and consume their builders', () => { const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'docs-report-interface-')); @@ -91,13 +92,13 @@ for (const name of ['ship-docsync-completion', 'ship-docsync-current', 'ship-doc await expect(callbacks.get(name)()).rejects.toBe(stopped); expect(launched).toBe(before + 1); expect(fs.existsSync(fixture.home)).toBe(false); - }); + }, ${CALLBACK_TEST_MS}); } `); const result = Bun.spawnSync([process.execPath, 'test', script], { env: { ...process.env, EVALS: '', EVALS_TIER: '', EVALS_ALL: '', EVALS_RUN_ID: 'free-docsync-interface', GSTACK_EVAL_DIR: path.join(dir, 'evidence'), GSTACK_HOME: path.join(dir, 'state') }, - stdout: 'pipe', stderr: 'pipe', timeout: 120_000, + stdout: 'pipe', stderr: 'pipe', timeout: callbackBudgetMs(4), }); const output = result.stdout.toString() + result.stderr.toString(); expect(result.exitCode, output).toBe(0); @@ -106,4 +107,4 @@ for (const name of ['ship-docsync-completion', 'ship-docsync-current', 'ship-doc } finally { fs.rmSync(dir, { recursive: true, force: true }); } -}); +}, callbackBudgetMs(4) + 10_000);