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
Directly restart Rollup when config file change is detected #4344
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#improve-watch-test or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #4344 +/- ##
==========================================
- Coverage 98.43% 98.43% -0.01%
==========================================
Files 206 206
Lines 7350 7344 -6
Branches 2088 2088
==========================================
- Hits 7235 7229 -6
Misses 55 55
Partials 60 60
Continue to review full report at Codecov.
|
In spite of the |
Hmm... it passed. I wonder if the fsync made any difference. |
066c280
to
964dfd4
Compare
In my opinion
The original random failures for this particular test was that it was producing Instead of a |
No, it means that no output was generated as When you get The race was more like an experiment. As it turned out, |
Yes, that's consistent with my understanding as well. :-)
My point was that the following error on macOS in the second last commit (and whose logic remains in some form in the latest PR commit) had never occurred before in the original randomly failing test on master which always had previously either emitted the erroneous
It shows the test's own newly introduced watch event fired incorrectly on macOS. This is why my vote would be to drop the watcher experiment in the test case. I suspect that watchers on macOS are not 100% reliable in general, and the original test failures on master were demonstrating a genuine watch bug on macOS. |
1f084ff
to
8edb784
Compare
and change test to look for a message from the second config
8edb784
to
baa6773
Compare
I changed the logic in Rollup to directly rebuild once a config file change is detected instead of waiting for the previous config file to be fully parsed. I think this makes more sense anyway as it allows to cancel a "stuck" config file by changing it. But it also allowed me to change the test so that the config file hooks into process.stderr to detect once Rollup has finished parsing the second config file. |
46e99ad
to
71dcc88
Compare
71dcc88
to
8e8b2a1
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
As there was another test failure on a branch, this one picks up a suggestion by @kzc to use
fs.fsync
to make sure an updated file is flushed to disk earlier.