test(telegram): stabilize spool timeout recovery assertions · openclaw/openclaw@9de6a99
vincentkoc
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1857,7 +1857,7 @@ describe("TelegramPollingSession", () => {
|
1857 | 1857 | createWorker, |
1858 | 1858 | drainIntervalMs: 100, |
1859 | 1859 | spooledUpdateHandlerTimeoutMs: 100, |
1860 | | -spooledUpdateHandlerAbortGraceMs: 5_000, |
| 1860 | +spooledUpdateHandlerAbortGraceMs: 100, |
1861 | 1861 | }, |
1862 | 1862 | }); |
1863 | 1863 | const firstRunPromise = firstSession.runUntilAbort(); |
@@ -1875,17 +1875,19 @@ describe("TelegramPollingSession", () => {
|
1875 | 1875 | createWorker, |
1876 | 1876 | drainIntervalMs: 100, |
1877 | 1877 | spooledUpdateHandlerTimeoutMs: 100, |
1878 | | -spooledUpdateHandlerAbortGraceMs: 5_000, |
| 1878 | +spooledUpdateHandlerAbortGraceMs: 100, |
1879 | 1879 | }, |
1880 | 1880 | }); |
1881 | 1881 | const secondRunPromise = secondSession.runUntilAbort(); |
1882 | 1882 | |
1883 | 1883 | await vi.advanceTimersByTimeAsync(1_000); |
1884 | 1884 | await vi.waitFor(async () => expect(await failedUpdateIds(tempDir)).toEqual([42])); |
1885 | | -expect(log.mock.calls).toEqual( |
1886 | | -expect.arrayContaining([ |
1887 | | -[expect.stringContaining("timed out spooled update 42 did not stop")], |
1888 | | -]), |
| 1885 | +await vi.waitFor(() => |
| 1886 | +expect( |
| 1887 | +log.mock.calls.some(([line]) => |
| 1888 | +String(line).includes("timed out spooled update 42 did not stop"), |
| 1889 | +), |
| 1890 | +).toBe(true), |
1889 | 1891 | ); |
1890 | 1892 | expect(handleUpdate).toHaveBeenCalledTimes(1); |
1891 | 1893 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。