test(codex): tolerate slower app-server startup · openclaw/openclaw@67e8d35
vincentkoc
·
2026-04-29
·
via Recent Commits to openclaw:main
File tree
extensions/codex/src/app-server
| Original file line number | Diff line number | Diff line change |
|---|
@@ -170,9 +170,19 @@ function createAppServerHarness(
|
170 | 170 | request, |
171 | 171 | requests, |
172 | 172 | async waitForMethod(method: string) { |
173 | | -await vi.waitFor(() => expect(requests.some((entry) => entry.method === method)).toBe(true), { |
174 | | -interval: 1, |
175 | | -}); |
| 173 | +await vi.waitFor( |
| 174 | +() => { |
| 175 | +if (!requests.some((entry) => entry.method === method)) { |
| 176 | +const mockMethods = request.mock.calls.map(([calledMethod]) => String(calledMethod)); |
| 177 | +throw new Error( |
| 178 | +`expected app-server method ${method}; saw ${requests |
| 179 | + .map((entry) => entry.method) |
| 180 | + .join(", ")}; mock saw ${mockMethods.join(", ")}`, |
| 181 | +); |
| 182 | +} |
| 183 | +}, |
| 184 | +{ interval: 1, timeout: 30_000 }, |
| 185 | +); |
176 | 186 | }, |
177 | 187 | async notify(notification: CodexServerNotification) { |
178 | 188 | await notify(notification); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。