-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use Dir instead of Base in DirectoryRefresher #21
Conversation
👀 @gitsen |
Thanks for the patch! CI is failing, also there is apparently a test that covers the refreshing behavior. Can you see how the expectations there differ from yours? Could be the test is wrong. |
Lgtm. Thanks for the fix. |
The test didn't catch this because it only does file creates, which would pass with the old implementation because the conditional wasn't grouped correctly:
meant that I can update tests so it also includes a Write |
@rodaine I closed and re-opened the PR to rerun tests. EDIT: never mind didn't realize the difference between |
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.
LGTM. The flakiness of these tests lead me to believe there's a race in there (though not from your patch). We'll want to investigate that further.
DirectoryRefresher is unable to pick up updates because the condition
filepath.Base(path) == d.currDir
effectively is never true. I think the intention was to usefilepath.Dir
here instead offilepath.Base
(which fetches only the last part of the path)Tests didn't catch this issue because of the malformed conditional. The tests only used file creates, which pass because of
|| op == Create