fix(infra) - Fix flake for file interactive system (#11019)

Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
This commit is contained in:
shishu314
2025-10-13 13:43:53 -04:00
committed by GitHub
parent 518caae62e
commit 4a5ef4d9f7
2 changed files with 31 additions and 14 deletions
+28
View File
@@ -585,6 +585,34 @@ export class TestRig {
);
}
async expectToolCallSuccess(toolNames: string[], timeout?: number) {
// Use environment-specific timeout
if (!timeout) {
timeout = getDefaultTimeout();
}
// Wait for telemetry to be ready before polling for tool calls
await this.waitForTelemetryReady();
const success = await poll(
() => {
const toolLogs = this.readToolLogs();
return toolNames.some((name) =>
toolLogs.some(
(log) => log.toolRequest.name === name && log.toolRequest.success,
),
);
},
timeout,
100,
);
expect(
success,
`Expected to find successful toolCalls for ${JSON.stringify(toolNames)}`,
).toBe(true);
}
async waitForAnyToolCall(toolNames: string[], timeout?: number) {
// Use environment-specific timeout
if (!timeout) {