diff --git a/extensions/codex/src/app-server/run-attempt.test.ts b/extensions/codex/src/app-server/run-attempt.test.ts index 2566b2602b8..b8dbfcace05 100644 --- a/extensions/codex/src/app-server/run-attempt.test.ts +++ b/extensions/codex/src/app-server/run-attempt.test.ts @@ -170,9 +170,19 @@ function createAppServerHarness( request, requests, async waitForMethod(method: string) { - await vi.waitFor(() => expect(requests.some((entry) => entry.method === method)).toBe(true), { - interval: 1, - }); + await vi.waitFor( + () => { + if (!requests.some((entry) => entry.method === method)) { + const mockMethods = request.mock.calls.map(([calledMethod]) => String(calledMethod)); + throw new Error( + `expected app-server method ${method}; saw ${requests + .map((entry) => entry.method) + .join(", ")}; mock saw ${mockMethods.join(", ")}`, + ); + } + }, + { interval: 1, timeout: 30_000 }, + ); }, async notify(notification: CodexServerNotification) { await notify(notification);