-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
Pull request #378 + test #380
Conversation
fs.rmdirSync(parentPath); | ||
d(function() { | ||
fs.mkdirSync(parentPath); | ||
d(function() { |
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.
Is there really a need for a delay between these two mkdirSync
s?
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.
Yes, probably because the timeout below needs to be more than 900ms, which is the max that d() allows.
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.
Those values are fairly arbitrary - based on what seemed to work consistently for the other tests. You're free to use setTimeout
directly if it works out more cleanly for this particular situation.
Added a test to demonstrate.
Are you referring to parent.remove(item)? It doesn't call _closers(path), so FsWatchInstances isn't cleared, so the new directory doesn't get a new fs.watch instance. If you tell me the correct way to fix, I can make the change. |
fs.mkdirSync(parentPath); | ||
d(function() { | ||
fs.mkdirSync(subPath); | ||
waitFor([unlinkSpy], d(function() { |
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.
This assertion should move up to happen right after the directory is removed, and the recreation to happen within that callback after this assertion has passed.
Ah, ok. I'll try to evaluate more closely to see if I can identify a better alternative than this approach. It is causing a regression on another test, so we'll have to figure out how to correct that. |
Your own test is actually failing as well currently. Thanks for the new PR, though. Provides a much better basis from which to confirm the problem and work on a fix. Btw your commits are not lining up with your github account. See https://help.github.com/articles/setting-your-email-in-git/ |
Yeah, my laptop is configured for work, I'll change that. Now that I'm playing around with the test, I get intermittent failures, too. Probably need a longer timeout. |
Already have a lot of delays... Kinda scary that it would need even more for this to work consistently. But I guess yeah let's do whatever it takes to get it working first, then we can look for opportunities to optimize. |
3b42de4
to
20c8081
Compare
… event If we add a watch on directory A, mkdir A/B, rm -r A/B, mkdir A/B, mkdir A/B/C, no event comes from fs.watch on creation of A/B/C
Ok, all tests are passing and the commits have my name on them. I still have 2 tests failing locally:
But they don't fail if I run them individually or via |
Yeah don't worry about those two. I need to do more work to stabilize them. |
|
No, that's just coveralls being flaky. Don't worry about it. |
Cool. Appreciate your persistence on this. Thanks. |
If we add a watch on directory A, mkdir A/B, rm -r A/B, mkdir A/B,
mkdir A/B/C, no event comes from fs.watch on creation of A/B/C
Encountered on Ubuntu 14.04.3 LTS, Linux 3.16.0-50-generic x86_64