Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle async Remix navigation properly #4839

Closed
wants to merge 5 commits into from
Closed

Conversation

gbalint
Copy link
Contributor

@gbalint gbalint commented Feb 6, 2024

Problem:
I believe the Remix tests are flaky for 2 reasons:

  1. the remix router navigate functions are async, and we just call them with void in the RemixNavigationContext.back/forward/home functions. And these are the function which are called in the mouse event handlers of the remix navigation buttons.

  2. In the tests we wait for getDispatchFollowUpActionsFinished, but that doesn't really help, because remix navigation does not trigger a dispatch (but it still triggers a rerender, and we have to wait for that)

Fix:
Since it is really hard to expose the event of finishing of the navigation and the rendering, so I just decided to use the waitFor helper of react testing library, which can wait for a given timeout until an expectation is true.

@gbalint gbalint marked this pull request as draft February 6, 2024 11:44
Copy link
Contributor

github-actions bot commented Feb 6, 2024

Try me

Copy link

relativeci bot commented Feb 6, 2024

Job #10245: Bundle Size — 62.35MiB (~-0.01%).

a09bca4(current) vs 794431b master#10224(baseline)

Warning

Bundle contains 66 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Improvement 1 improvement
                 Current
Job #10245
     Baseline
Job #10224
Improvement  Initial JS 35.39MiB(~-0.01%) 35.39MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 20.23% 21.77%
No change  Chunks 28 28
No change  Assets 32 32
No change  Modules 4407 4407
No change  Duplicate Modules 490 490
No change  Duplicate Code 30.7% 30.7%
No change  Packages 462 462
No change  Duplicate Packages 65 65
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
Job #10245
     Baseline
Job #10224
Not changed  JS 62.34MiB 62.34MiB
Improvement  HTML 11.37KiB (-0.32%) 11.41KiB

View job #10245 reportView fix/flaky-remix-test-3 branch activityView project dashboard

Copy link
Contributor

github-actions bot commented Feb 6, 2024

Performance test results:
Highlight Regular (-2%)

Highlight All Elements (0%)

Selection (4%)

De-Selection (6%)
Before: 9.9ms (8-16.8ms)
After: 10.5ms (8.3-16.9ms)

Selection Change (2%)

Scroll Canvas (22%)
Before: 3.2ms (2.4-9.7ms)
After: 3.9ms (2.8-8.5ms)

(Chart1)
(Chart2)

Copy link
Contributor

github-actions bot commented Feb 6, 2024

Performance test results:

@gbalint gbalint closed this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant