test: speed up subagent registry persistence tests · openclaw/openclaw@2acd6ae
shakkernerd
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -188,6 +188,8 @@ describe("subagent registry persistence", () => {
|
188 | 188 | }; |
189 | 189 | |
190 | 190 | beforeEach(() => { |
| 191 | +announceSpy.mockReset(); |
| 192 | +announceSpy.mockResolvedValue(true); |
191 | 193 | __testing.setDepsForTest({ |
192 | 194 | ...createSubagentRegistryTestDeps(), |
193 | 195 | persistSubagentRunsToDisk: fastPersistSubagentRunsToDisk, |
@@ -204,7 +206,6 @@ describe("subagent registry persistence", () => {
|
204 | 206 | }); |
205 | 207 | |
206 | 208 | afterEach(async () => { |
207 | | -announceSpy.mockClear(); |
208 | 209 | __testing.setDepsForTest(); |
209 | 210 | resetSubagentRegistryForTests({ persist: false }); |
210 | 211 | await drainSessionStoreWriterQueuesForTest(); |
@@ -670,6 +671,15 @@ describe("subagent registry persistence", () => {
|
670 | 671 | }); |
671 | 672 | |
672 | 673 | it("keeps stale unended restored runs with abortedLastRun for restart recovery", async () => { |
| 674 | +vi.mocked(callGateway).mockImplementationOnce(async (request) => { |
| 675 | +expect(request).toMatchObject({ |
| 676 | +method: "agent.wait", |
| 677 | +params: { runId: "run-stale-aborted-restore" }, |
| 678 | +}); |
| 679 | +return { |
| 680 | +status: "pending", |
| 681 | +}; |
| 682 | +}); |
673 | 683 | const now = Date.now(); |
674 | 684 | const runId = "run-stale-aborted-restore"; |
675 | 685 | const childSessionKey = "agent:main:subagent:stale-aborted-restore"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。