From 9bbd32a72d2e6fc744b2d4269ea46674e73058b1 Mon Sep 17 00:00:00 2001 From: Alex Nahas Date: Wed, 23 Sep 2026 13:01:59 -0700 Subject: [PATCH] Give the fork's identity tests the suite's connection timeout The two useAgent identity tests the fork added in db417b5f wait for a fresh agent's identity callback with vi.waitFor's default one-second window. Every other connection wait in rpc-robustness.test.tsx passes { timeout: 10000 }. On a cold CI runner the first connection to a new Durable Object took longer than a second, so "starts identity comparison over when the requested address changes" failed on main right after the 0.9.0 release merge with zero calls recorded. Give its four waits the same ten seconds as the rest of the file. Co-Authored-By: Claude Opus 5.5 --- .../src/react-tests/rpc-robustness.test.tsx | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/vendor/agents/packages/agents/src/react-tests/rpc-robustness.test.tsx b/vendor/agents/packages/agents/src/react-tests/rpc-robustness.test.tsx index d827126..9d434e0 100644 --- a/vendor/agents/packages/agents/src/react-tests/rpc-robustness.test.tsx +++ b/vendor/agents/packages/agents/src/react-tests/rpc-robustness.test.tsx @@ -587,11 +587,13 @@ describe("useAgent RPC robustness", () => { }} /> ); - await vi.waitFor(() => - expect(onIdentity).toHaveBeenCalledWith( - baseOptions.name, - "test-callable-agent" - ) + await vi.waitFor( + () => + expect(onIdentity).toHaveBeenCalledWith( + baseOptions.name, + "test-callable-agent" + ), + { timeout: 10000 } ); for (const name of [ `identity-b-${crypto.randomUUID()}`, @@ -599,8 +601,13 @@ describe("useAgent RPC robustness", () => { ]) { onIdentity.mockClear(); setOptions!({ ...baseOptions, name }); - await vi.waitFor(() => - expect(onIdentity).toHaveBeenCalledWith(name, "test-callable-agent") + await vi.waitFor( + () => + expect(onIdentity).toHaveBeenCalledWith( + name, + "test-callable-agent" + ), + { timeout: 10000 } ); await expect(latestAgent!.call("add", [2, 3])).resolves.toBe(5); } @@ -633,17 +640,24 @@ describe("useAgent RPC robustness", () => { }} /> ); - await vi.waitFor(() => - expect(onIdentity).toHaveBeenCalledWith(firstUser, "test-state-agent") + await vi.waitFor( + () => + expect(onIdentity).toHaveBeenCalledWith( + firstUser, + "test-state-agent" + ), + { timeout: 10000 } ); setOptions!({ ...baseOptions, query: { user: secondUser } }); - await vi.waitFor(() => - expect(onIdentityChange).toHaveBeenCalledWith( - firstUser, - secondUser, - "test-state-agent", - "test-state-agent" - ) + await vi.waitFor( + () => + expect(onIdentityChange).toHaveBeenCalledWith( + firstUser, + secondUser, + "test-state-agent", + "test-state-agent" + ), + { timeout: 10000 } ); });