🧪 ci: De-flake ConversationsSection memoization spec on slow runners (#14071)

waitFor resolves as soon as BookmarkNav's data hook has fired once, but the Suspense resolution commit can still have a trailing render pass pending on slow runners (Windows CI shards). The first stream tick then flushes that leftover pass alongside the tick, inflating the memoized children's render counts past the captured baseline (Expected: 1, Received: 2). Flush pending commits with an empty async act() before capturing baselines.
This commit is contained in:
Danny Avila 2026-07-02 10:11:43 -04:00 committed by GitHub
parent 0eef64344d
commit 477ee3439c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -144,6 +144,12 @@ describe('ConversationsSection streaming re-renders', () => {
// data hook firing is the deterministic signal that the chunk resolved).
await waitFor(() => expect(mockUseGetConversationTags).toHaveBeenCalled());
// waitFor resolves as soon as the hook has fired once, but the Suspense
// resolution commit can still have a trailing render pass pending on slow
// runners (Windows CI shards). Flush it before capturing baselines so the
// first stream tick doesn't carry it and inflate the children's counts.
await act(async () => {});
expect(mockUseFavorites.mock.calls.length).toBeGreaterThan(0);
expect(mockUseGetConversationTags.mock.calls.length).toBeGreaterThan(0);