Skip to content

Commit 4f228d1

Browse files
committed
Raise test timeouts across the spawn-heavy suite for Windows CI
terminal-manager.test.ts hit the same class of failure as the resource-monitor fix: a spawn-and-poll test's local waitFor() default (5000ms) coincided with vitest's outer 5000ms default, so a slow PTY spawn on Windows CI runners tripped the outer timeout before the helper's own error could fire. Rather than patch each spawn-heavy file as CI surfaces the next one, set a 20s testTimeout globally in vitest.config.ts and raise the local waitFor() defaults in terminal-manager.test.ts and agent-tools.test.ts (both hit the same pattern) to 12s, giving genuine headroom instead of just a longer outer ceiling around an already-too-tight inner one.
1 parent 949f925 commit 4f228d1

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

app/src/agent-tools.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ import {
3838
applyPatch,
3939
} from "./agent-tools";
4040

41-
function waitFor(predicate: () => boolean, timeoutMs = 5000): Promise<void> {
41+
// 5000ms was tight enough that a slow spawn on Windows CI could still hit
42+
// vitest's outer testTimeout (see app/vitest.config.ts) before this helper's
43+
// own, more descriptive error had a chance to fire.
44+
function waitFor(predicate: () => boolean, timeoutMs = 12_000): Promise<void> {
4245
const start = Date.now();
4346
return new Promise((resolve, reject) => {
4447
const check = () => {
@@ -487,7 +490,7 @@ describe("agent-tools", () => {
487490
closeAllTerminals();
488491
});
489492

490-
function waitFor(predicate: () => boolean | Promise<boolean>, timeoutMs = 5000): Promise<void> {
493+
function waitFor(predicate: () => boolean | Promise<boolean>, timeoutMs = 12_000): Promise<void> {
491494
const start = Date.now();
492495
return new Promise((resolve, reject) => {
493496
const check = async () => {

app/src/terminal-manager.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import {
1313
listTerminals,
1414
} from "./terminal-manager";
1515

16-
function waitFor(predicate: () => boolean, timeoutMs = 5000): Promise<void> {
16+
// 5000ms was tight enough that a slow PTY spawn on Windows CI could still
17+
// hit vitest's outer testTimeout (see app/vitest.config.ts) before this
18+
// helper's own, more descriptive error had a chance to fire.
19+
function waitFor(predicate: () => boolean, timeoutMs = 12_000): Promise<void> {
1720
const start = Date.now();
1821
return new Promise((resolve, reject) => {
1922
const check = () => {

app/vitest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@ export default defineConfig({
1010
test: {
1111
environment: "node",
1212
include: ["src/**/*.test.ts"],
13+
// Several tests spawn a real child process or PTY and poll for
14+
// observable output (agent-tools.test.ts, resource-monitor.test.ts,
15+
// terminal-manager.test.ts). Vitest's 5000ms default has repeatedly
16+
// been too tight for that on Windows CI runners, where process/PTY
17+
// spawn is noticeably slower than on Linux/macOS — this raises the
18+
// floor for the whole suite instead of chasing each Windows-only
19+
// flake one file at a time as it turns up.
20+
testTimeout: 20_000,
1321
},
1422
});

0 commit comments

Comments
 (0)