-
-
Notifications
You must be signed in to change notification settings - Fork 391
Fix flaky test #2835
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
Fix flaky test #2835
Conversation
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.
Thanks for looking into this! I ran the testsuite a couple of times but could not reproduce this failure locally at all.
I'm confused, that doesn't look like what the change does? And I don't see the comment you mentioned being deleted? |
3f50c36
to
94511f2
Compare
Fixed now, thanks for noticing this. I must have forgotten to |
94511f2
to
52886d5
Compare
641c402
to
721c435
Compare
* Fix flaky test * add comment
"add missing modules (non workspace)" became flaky after the recent changes to snapshot VFS data.
The test calls
createDoc
to open amodule B imports A
whereA
does not exist, then waits for the missing module error and callscreateDoc
to open amodule A
. Importantly, bothB
andA
live outside the workspace and thus are not subject toFileWatched
notifications.Unfortunately, the test wasn't testing the right thing because
createDoc
sends aFileWatched
notification right before sending aDidOpen
notification! This was causing a race condition, where theFileWatched
notification triggers a build that may or may not run theFileExists ModuleA
key:False
sinceModuleA
exists neither in the file system nor in VFS, and the test will fail since the key will not get rebuilt again (nothing dirties it).DidOpen
notification) and will return true because the file now exists in VFS.I imagine that the test was passing before since the VFS state would get updated concurrently, and the race condition would not get triggered in practice.
To fix the test, we simply tell
lsp-test
not to sendFileWatched
notifications.I also found an old comment stating that "VFS existence is not enough, a file must exist in disk". This is clearly not true anymore, so I have deleted it.
Fixes #2831