Skip to content

test(router-core): fix flakiness of store-updates 'preload then navigate' test - #4995

Merged
Sheraff merged 1 commit into
mainfrom
test-router-core-store-updates-flaky
Aug 19, 2025
Merged

test(router-core): fix flakiness of store-updates 'preload then navigate' test#4995
Sheraff merged 1 commit into
mainfrom
test-router-core-store-updates-flaky

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator

It turns out the 'hover preload, then navigate, w/ async loaders' test in packages/react-router/tests/store-updates-during-navigation.test.tsx was sometimes (but very rarely) yielding 16 updates instead of the expected 15. This PR makes minimal changes to this test so that it's now reliably 14.

I'm not exactly sure where we lost that 1 update, so we might not be measuring exactly the same thing. But it's still worth it to have a robust test suite.

Summary by CodeRabbit

  • Tests
    • Improved reliability of hover preloading and navigation behavior tests by introducing realistic loader delays and aligning interaction timing, reducing flakiness.
    • Updated assertions for store updates during navigation to reflect observed behavior, ensuring more stable and predictable test outcomes.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant