-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: fix flaky test-fs-watch-recursive on OS X #9303
Conversation
The test was sometimes timing out due to a race condition. In OS X, events for `fs.watch()` might only start showing up after a delay. This is a limitation of the operating system. To work around that, there was a timer in the test that delayed the writing of the file by 100ms. However, sometimes that was not enough, and so the event never fired, and the test timed out. Change the timer to an interval so that it fires repeatedly until it is picked up. This change only affects OS X. Fixes: nodejs#8511
@Trott, what about updating "watcherClosed" to use "let", and "interval" to use "const"? |
Linter passed, OS X passed, and Windows passed. The test does not run on any other platforms. So CI looks ✅ as far as relevant results go. |
Not using I don't a great a reason for avoiding |
The test was sometimes timing out due to a race condition. In OS X, events for `fs.watch()` might only start showing up after a delay. This is a limitation of the operating system. To work around that, there was a timer in the test that delayed the writing of the file by 100ms. However, sometimes that was not enough, and so the event never fired, and the test timed out. Change the timer to an interval so that it fires repeatedly until it is picked up. This change only affects OS X. Fixes: nodejs#8511 PR-URL: nodejs#9303 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Landed in fd54df1 |
The test was sometimes timing out due to a race condition. In OS X, events for `fs.watch()` might only start showing up after a delay. This is a limitation of the operating system. To work around that, there was a timer in the test that delayed the writing of the file by 100ms. However, sometimes that was not enough, and so the event never fired, and the test timed out. Change the timer to an interval so that it fires repeatedly until it is picked up. This change only affects OS X. Fixes: #8511 PR-URL: #9303 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
The test was sometimes timing out due to a race condition. In OS X, events for `fs.watch()` might only start showing up after a delay. This is a limitation of the operating system. To work around that, there was a timer in the test that delayed the writing of the file by 100ms. However, sometimes that was not enough, and so the event never fired, and the test timed out. Change the timer to an interval so that it fires repeatedly until it is picked up. This change only affects OS X. Fixes: #8511 PR-URL: #9303 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
The test was sometimes timing out due to a race condition. In OS X, events for `fs.watch()` might only start showing up after a delay. This is a limitation of the operating system. To work around that, there was a timer in the test that delayed the writing of the file by 100ms. However, sometimes that was not enough, and so the event never fired, and the test timed out. Change the timer to an interval so that it fires repeatedly until it is picked up. This change only affects OS X. Fixes: #8511 PR-URL: #9303 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test fs
Description of change
The test was sometimes timing out due to a race condition. In OS X,
events for
fs.watch()
might only start showing up after a delay. Thisis a limitation of the operating system. To work around that, there was
a timer in the test that delayed the writing of the file by 100ms.
However, sometimes that was not enough, and so the event never fired,
and the test timed out.
Change the timer to an interval so that it fires repeatedly until it is
picked up. This change only affects OS X.
Fixes: #8511
/cc @nodejs/testing