From 477ee3439cba57f4574878155f97d8fff842fbd4 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 2 Jul 2026 10:11:43 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20ci:=20De-flake=20ConversationsSe?= =?UTF-8?q?ction=20memoization=20spec=20on=20slow=20runners=20(#14071)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../UnifiedSidebar/__tests__/ConversationsSection.spec.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/components/UnifiedSidebar/__tests__/ConversationsSection.spec.tsx b/client/src/components/UnifiedSidebar/__tests__/ConversationsSection.spec.tsx index 219aea5132..473eb445d8 100644 --- a/client/src/components/UnifiedSidebar/__tests__/ConversationsSection.spec.tsx +++ b/client/src/components/UnifiedSidebar/__tests__/ConversationsSection.spec.tsx @@ -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);