Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/cli/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default defineConfig({
},
},
test: {
// See packages/core/vitest.config.ts: raise the per-test ceiling above
// vitest's 5s default so I/O-bound tests (e.g. the workspace registration
// store's tempdir round-trip) don't blow it purely under CI contention.
testTimeout: 15000,
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)', 'config.test.ts'],
exclude: ['**/node_modules/**', '**/dist/**', '**/cypress/**'],
environment: 'jsdom',
Expand Down
9 changes: 7 additions & 2 deletions packages/core/src/extension/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2075,9 +2075,14 @@ describe('git extension helpers', () => {
}

async function waitForFileData(filePath: string): Promise<void> {
for (let attempt = 0; attempt < 1_000; attempt += 1) {
// Poll on a real wall-clock budget (~10s), not a fixed iteration count:
// setImmediate turns are sub-millisecond, so 1_000 of them could elapse
// in <100ms while the tar extraction I/O is still catching up on a
// contended runner — the source of the "Timed out waiting for extracted
// data" flake. Stays well under the 15s per-test ceiling.
for (let attempt = 0; attempt < 2_000; attempt += 1) {
if ((await getFileSize(filePath)) > 0) return;
await new Promise((resolve) => setImmediate(resolve));
await new Promise((resolve) => setTimeout(resolve, 5));
}
throw new Error(`Timed out waiting for extracted data at ${filePath}`);
}
Expand Down
6 changes: 6 additions & 0 deletions packages/core/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
// Raise the per-test ceiling above vitest's 5s default: the self-hosted
// CI runners are heavily oversubscribed (maxThreads: 16 below), and I/O-
// or WASM-load-bound tests (e.g. the web-tree-sitter lazy runtime, tar
// extraction) blow 5s purely under contention, not from any logic fault.
// Assertions still fail instantly; only the timeout ceiling grows.
testTimeout: 15000,
reporters: ['default', 'junit'],
silent: true,
setupFiles: ['./test-setup.ts'],
Expand Down
Loading