-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Add smoke test for flight fixture #28350
Conversation
Comparing: 59fe6c3...0a7acc5 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
220c0f7
to
bf65cbe
Compare
418f4da
to
51401ff
Compare
.circleci/config.yml
Outdated
working_directory: fixtures/flight | ||
command: | | ||
yarn build | ||
# Need to build twice for unknown reasons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we get https://app.circleci.com/pipelines/github/facebook/react/50479/workflows/7727b75f-e654-4558-9294-a2a710b8ebbd/jobs/783757/steps
Which the fixture also catches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe if you set FAST_REFRESH=false
, you can skip the build step completely. This is how I verified this locally: rm -rf build ./node_modules/.cache && FAST_REFRESH=false yarn test
. My understanding is that this avoids needing to transform the node_modules/react-refresh
ES modules (which seems to occur too late on the first run).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, this would just mask the issue that users might run into when trying to run the flight fixture locally. Is fast refresh that useful for the fixture? If not, we could also disable it in fixtures/flight/config/env.js
, and not only in the CI.
Without the fix from #28353 I do get hydration mismatches because the chunk script tags (mentioned as "preloads" in the PR) are rendered outside of <script src="/static/js/client2.chunk.js" async=""></script>
<script src="/static/js/client3.chunk.js" async=""></script>
<script src="/static/js/client8.chunk.js" async=""></script>
<script src="/static/js/client7.chunk.js" async=""></script>
<script src="/static/js/client6.chunk.js" async=""></script>
<script src="/static/js/client0.chunk.js" async=""></script>
<script src="/static/js/client4.chunk.js" async=""></script>
<script src="/static/js/client1.chunk.js" async=""></script>
<script src="/static/js/client9.chunk.js" async=""></script>
<!DOCTYPE html>
<html lang="en">
<head> |
Could you clarify how this manifests other than having to manually inspect the produced HTML? I get no console warnings which you'd usually get for hydration mismatches. |
1c182d4
to
d036d62
Compare
That's strange. When I check out 4a54e8a (so before the fix), I get the expected console errors.
|
For what it's worth, even with the console errors, and the "Hello World" expectation that was added later, I can't get the tests to fail consistently. Only when I add |
Can you post the exact instructions how you get the fixture running for you on a fresh clone? |
With the following steps I got the fixture running on a fresh clone:
And with that, I got a running flight fixture, strangely now without any hydration mismatches. 🙄 |
I was missing that bit. Fast Refresh randomly starts working after a couple of failed |
Ah, I didn't realise that #28353 was merged into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, even with the console errors, and the "Hello World" expectation that was added later, I can't get the tests to fail consistently. Only when I add
await page.reload();
afterawait page.goto('/');
it fails consistently (sometimes with two sets of errors though). Hopefully there's a better fix for this flakiness.
@eps1lon Since this is not addressed yet, I believe there will be false positive test results whenever a console error may appear due to some changes in the code base.
The idea is that we prevent these from creeping in since that's an error. console.errors are not false positives. If they are expected, they can be added to the assertion. I'll try the page.reload(). Thank your for the tip |
I meant "false positive test results" as in there might be a successful test despite console errors occurring, due to the test exiting before the calls could have been collected. |
I tested the latest version of this PR again, but without d37ca84, and now I do get consistent test failures, as expected. So maybe there's no need to change the test, after all. |
03660c7
to
0a7acc5
Compare
Didn't detect any flakiness while running locally so let's see how CI treats it. |
### React upstream changes - facebook/react#28438 - facebook/react#28436 - facebook/react#25954 - facebook/react#28434 - facebook/react#28433 - facebook/react#28432 - facebook/react#28415 - facebook/react#27903 - facebook/react#28430 - facebook/react#28424 - facebook/react#28400 - facebook/react#28422 - facebook/react#28423 - facebook/react#28412 - facebook/react#28418 - facebook/react#28421 - facebook/react#28417 - facebook/react#28399 - facebook/react#28408 - facebook/react#28350 - facebook/react#28387 - facebook/react#28403 - facebook/react#28384 - facebook/react#28409 - facebook/react#28398 - facebook/react#28405 - facebook/react#28328 - facebook/react#28402 - facebook/react#28386 - facebook/react#28388 - facebook/react#28379 - facebook/react#28383 - facebook/react#28390 - facebook/react#28389 - facebook/react#28382 - facebook/react#28348 Closes NEXT-2600
DiffTrain build for commit 81d2a51.
Not working in CI yet. Needs Node.js 20
Summary
The test just opens the page for now and asserts that no console errors or uncaught errors happens. This would've caught the breakage that was fixed in #28352
How did you test this change?
yarn build && cd fixtures/flight && yarn && yarn build && yarn build && yarn test