You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(react-db): fix flaky test by preventing race condition
The test "optimistic state is dropped after commit" was flaky because it had a race condition:
1. The test would wait for state size to become 4
2. Then immediately check that the temp-key exists
3. However, the async mutation (with only 10ms delay) could complete between steps 1 and 2
Fixed by moving all assertions into the same waitFor() block, ensuring they execute atomically.
This prevents the mutation from completing between the size check and the temp-key verification.
Co-authored-by: Claude <[email protected]>
0 commit comments