mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
test(codex): tolerate slower app-server startup
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user