mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-11 00:33:40 +00:00
🧪 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:
parent
0eef64344d
commit
477ee3439c
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue