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 |
rodaine
left a comment
There was a problem hiding this comment.
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.currDireffectively is never true. I think the intention was to usefilepath.Dirhere 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