mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-07 17:28:23 +01:00
test: mark the two intended timing bounds with gstack-timing-ok (GSTA-262)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
659af13388
commit
e042b5e7af
2 files changed
+2
No files matched your search
@@ -66,6 +66,7 @@ mock.module(path.join(root, 'test/helpers/session-runner.ts'), () => ({ async ru
|
||||
const scenario = legacy ? 'legacy-completion' : options.testName.slice('ship-docsync-'.length);
|
||||
expect(options.maxTurns).toBe(legacy ? 30 : 24);
|
||||
const remaining = (legacy ? CAPTURE_LONG_MS : CAPTURE_MS) - 15_000;
|
||||
// gstack-timing-ok: runShipDocsFault derives the timeout from elapsed time, so the bound measures the same elapsed time
|
||||
expect(options.timeout).toBeGreaterThanOrEqual(remaining - (Date.now() - bodyStartedAt));
|
||||
expect(options.timeout).toBeLessThanOrEqual(remaining);
|
||||
expect(options.tools).toEqual(['Bash', 'Read', 'Write', 'Edit', 'Glob', 'Grep']);
|
||||
|
||||
@@ -110,6 +110,7 @@ const run = async opts => {
|
||||
opts.signal?.addEventListener('abort', () => events.push('abort-' + attempt), { once: true });
|
||||
if (attempt === 1) {
|
||||
await new Promise(resolve => opts.signal.addEventListener('abort', resolve, { once: true }));
|
||||
// gstack-timing-ok: the drain after cancellation is the behavior under test; no deadline remains during it
|
||||
await Bun.sleep(drainMs);
|
||||
}
|
||||
expect(fs.existsSync(opts.workingDirectory)).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user