mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
fix(tests): reduce flakiness in simple mcp server test (#8583)
This commit is contained in:
@@ -189,6 +189,25 @@ describe('simple-mcp-server', () => {
|
|||||||
const { chmodSync } = await import('node:fs');
|
const { chmodSync } = await import('node:fs');
|
||||||
chmodSync(testServerPath, 0o755);
|
chmodSync(testServerPath, 0o755);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Poll for script for up to 5s
|
||||||
|
const { accessSync, constants } = await import('node:fs');
|
||||||
|
const isReady = await rig.poll(
|
||||||
|
() => {
|
||||||
|
try {
|
||||||
|
accessSync(testServerPath, constants.F_OK);
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
5000, // Max wait 5 seconds
|
||||||
|
100, // Poll every 100ms
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!isReady) {
|
||||||
|
throw new Error('MCP server script was not ready in time.');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add two numbers', async () => {
|
it('should add two numbers', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user