Skip to content

Commit 5675ebd

Browse files
committed
fix(test): relax slow Windows integration timeouts
1 parent bed5064 commit 5675ebd

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

‎tests/impact-2hop.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
RELATIONSHIPS_FILENAME
1616
} from '../src/constants/codebase-context.js';
1717

18+
const SLOW_WINDOWS_TEST_TIMEOUT_MS = 60000;
19+
1820
vi.mock('../src/core/reranker.js', () => ({
1921
rerank: vi.fn(async (_query: string, results: unknown) => results),
2022
getRerankerStatus: vi.fn(() => 'fallback'),
@@ -127,5 +129,5 @@ describe('Impact candidates (2-hop)', () => {
127129
`Expected hop 2 candidate src/a.ts, got impact.details=${JSON.stringify(details)}`
128130
);
129131
}
130-
}, 30000);
132+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
131133
});

‎tests/search-compact-mode.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function parseSearchResponse(text: string): SearchResponse {
5050
return JSON.parse(text) as SearchResponse;
5151
}
5252

53+
const SLOW_WINDOWS_TEST_TIMEOUT_MS = 60000;
54+
5355
describe('search_codebase compact/full mode', () => {
5456
let tempRoot: string | null = null;
5557
let originalArgv: string[] | null = null;
@@ -572,7 +574,7 @@ describe('search_codebase compact/full mode', () => {
572574
expect(results[0].filePath).toBe(actualChunk.filePath);
573575
expect(results[0].imports).toEqual(actualChunk.imports);
574576
expect(results[0].exports).toEqual(actualChunk.exports);
575-
}, 30000);
577+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
576578

577579
it('adds a warning only when the final full payload exceeds the compact budget threshold', async () => {
578580
const oversizedSummary = 'Token-heavy summary '.repeat(1200);

‎tests/search-decision-card.test.ts‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ type ToolCallResponse = {
4040
isError?: boolean;
4141
};
4242

43+
const SLOW_WINDOWS_TEST_TIMEOUT_MS = 60000;
44+
4345
function getToolCallHandler(
4446
server: unknown
4547
): (request: ToolCallRequest) => Promise<ToolCallResponse> {
@@ -153,7 +155,7 @@ export class ProfileService {
153155
config: { skipEmbedding: true }
154156
});
155157
await indexer.index();
156-
}, 30000);
158+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
157159

158160
afterEach(async () => {
159161
if (originalArgv) {
@@ -170,7 +172,7 @@ export class ProfileService {
170172
await rmWithRetries(tempRoot);
171173
tempRoot = null;
172174
}
173-
}, 30000);
175+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
174176

175177
it('intent="edit" with multiple results returns full decision card with ready field', async () => {
176178
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -207,7 +209,7 @@ export class ProfileService {
207209
}
208210
expect(preflight.ready).toBeDefined();
209211
expect(typeof preflight.ready).toBe('boolean');
210-
}, 30000);
212+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
211213

212214
it('decision card has all expected fields when returned', async () => {
213215
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -259,7 +261,7 @@ export class ProfileService {
259261
if (preflight.whatWouldHelp) {
260262
expect(Array.isArray(preflight.whatWouldHelp)).toBe(true);
261263
}
262-
}, 30000);
264+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
263265

264266
it('intent="explore" returns lightweight preflight', async () => {
265267
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -290,7 +292,7 @@ export class ProfileService {
290292
expect(typeof preflight.ready).toBe('boolean');
291293
// Should NOT have full decision card fields for explore
292294
}
293-
}, 30000);
295+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
294296

295297
it('includes snippet field when includeSnippets=true', async () => {
296298
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -321,7 +323,7 @@ export class ProfileService {
321323
// At least some results should have a snippet
322324
const withSnippets = parsed.results.filter((result) => result.snippet);
323325
expect(withSnippets.length).toBeGreaterThan(0);
324-
}, 30000);
326+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
325327

326328
it('does not include snippet field when includeSnippets=false', async () => {
327329
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -350,7 +352,7 @@ export class ProfileService {
350352
parsed.results.forEach((result) => {
351353
expect(result.snippet).toBeUndefined();
352354
});
353-
}, 30000);
355+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
354356

355357
it('scope header starts snippet when includeSnippets=true', async () => {
356358
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -381,5 +383,5 @@ export class ProfileService {
381383
const firstLine = withSnippet.snippet.split('\n')[0].trim();
382384
expect(firstLine).toMatch(/^\/\//);
383385
}
384-
}, 30000);
386+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
385387
});

‎tests/search-snippets.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ vi.mock('../src/core/reranker.js', () => ({
1111
isAmbiguous: vi.fn(() => false)
1212
}));
1313

14+
const SLOW_WINDOWS_TEST_TIMEOUT_MS = 60000;
15+
1416
describe('Search Snippets with Scope Headers', () => {
1517
let tempRoot: string | null = null;
1618

@@ -98,15 +100,15 @@ export const VERSION = '1.0.0';
98100
config: { skipEmbedding: true }
99101
});
100102
await indexer.index();
101-
}, 30000);
103+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
102104

103105
afterEach(async () => {
104106
if (tempRoot) {
105107
await rmWithRetries(tempRoot);
106108
tempRoot = null;
107109
}
108110
delete process.env.CODEBASE_ROOT;
109-
}, 30000);
111+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
110112

111113
it('returns snippets when includeSnippets=true', async () => {
112114
if (!tempRoot) throw new Error('tempRoot not initialized');
@@ -136,7 +138,7 @@ export const VERSION = '1.0.0';
136138

137139
const withSnippets = parsed.results.filter((r: any) => r.snippet);
138140
expect(withSnippets.length).toBeGreaterThan(0);
139-
}, 30000);
141+
}, SLOW_WINDOWS_TEST_TIMEOUT_MS);
140142

141143
it('scope header is a comment line starting with //', async () => {
142144
if (!tempRoot) throw new Error('tempRoot not initialized');

0 commit comments

Comments
 (0)