Skip to content

Commit 907228d

Browse files
committed
test: raise timeouts for heavy search integration cases
1 parent cb24246 commit 907228d

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

tests/impact-2hop.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@ describe('Impact candidates (2-hop)', () => {
2929
tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'impact-2hop-'));
3030
const srcDir = path.join(tempRoot, 'src');
3131
await fs.mkdir(srcDir, { recursive: true });
32-
await fs.writeFile(path.join(tempRoot, 'package.json'), JSON.stringify({ name: 'impact-2hop' }));
33-
3432
await fs.writeFile(
35-
path.join(srcDir, 'c.ts'),
36-
`export function cFn() { return '${token}'; }\n`
33+
path.join(tempRoot, 'package.json'),
34+
JSON.stringify({ name: 'impact-2hop' })
35+
);
36+
await fs.writeFile(path.join(srcDir, 'c.ts'), `export function cFn() { return '${token}'; }\n`);
37+
await fs.writeFile(
38+
path.join(srcDir, 'b.ts'),
39+
`import { cFn } from './c';\nexport const b = cFn();\n`
40+
);
41+
await fs.writeFile(
42+
path.join(srcDir, 'a.ts'),
43+
`import { b } from './b';\nexport const a = b;\n`
3744
);
38-
await fs.writeFile(path.join(srcDir, 'b.ts'), `import { cFn } from './c';\nexport const b = cFn();\n`);
39-
await fs.writeFile(path.join(srcDir, 'a.ts'), `import { b } from './b';\nexport const a = b;\n`);
4045

4146
const indexer = new CodebaseIndexer({
4247
rootPath: tempRoot,
@@ -122,5 +127,5 @@ describe('Impact candidates (2-hop)', () => {
122127
`Expected hop 2 candidate src/a.ts, got impact.details=${JSON.stringify(details)}`
123128
);
124129
}
125-
});
130+
}, 30000);
126131
});

tests/search-compact-mode.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,8 @@ describe('search_codebase compact/full mode', () => {
559559
'utf-8'
560560
);
561561

562-
const actualSearchModule = await vi.importActual<typeof import('../src/core/search.js')>(
563-
'../src/core/search.js'
564-
);
562+
const actualSearchModule =
563+
await vi.importActual<typeof import('../src/core/search.js')>('../src/core/search.js');
565564
const searcher = new actualSearchModule.CodebaseSearcher(tempRoot);
566565
const results = await searcher.search('AuthService token', 5, undefined, {
567566
useSemanticSearch: false,
@@ -573,7 +572,7 @@ describe('search_codebase compact/full mode', () => {
573572
expect(results[0].filePath).toBe(actualChunk.filePath);
574573
expect(results[0].imports).toEqual(actualChunk.imports);
575574
expect(results[0].exports).toEqual(actualChunk.exports);
576-
});
575+
}, 30000);
577576

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

tests/search-snippets.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const VERSION = '1.0.0';
136136

137137
const withSnippets = parsed.results.filter((r: any) => r.snippet);
138138
expect(withSnippets.length).toBeGreaterThan(0);
139-
});
139+
}, 30000);
140140

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

0 commit comments

Comments
 (0)