Fix various test flakiness#2331
Merged
Merged
Conversation
This commit addresses various test flakiness: 1. Bump timeouts for queries tests 2. Add a dispose handler to queryserver-client. This will help us during tests because if there is a test that timesout while a query is running, the query's progress callback won't be invoked. We will still get a timeout error in the first test, but the second test will not get a spurious error. 3. Handle a disposed query server in `deregisterDatabase`. This method will remove the database from the currently running query server. If there is no query server, then there is nothing to remove. So, this error is safe to ignore. 4. Explicitly `end()` a connection `ServerProcess`. I'm not 100% sure if this is necessary, but it seems like it prevents responses from being handled and erroring out. 5. Better handling of ideServer restarts. Previously, if you quickly called `CodeQL: Restart Query Server` twice in a row, you would get an error from the ideServer restart. Restart fails if the server is not already started. So, in this case just call a start.
1 task
Contributor
Author
|
My change to bump the timeout probably conflicts with #2326. I can remove that. |
A global timeout has already been set.
robertbrignull
approved these changes
Apr 17, 2023
Contributor
robertbrignull
left a comment
There was a problem hiding this comment.
I don't have much context on many of these areas, but everything here looks reasonable. I can't see anything obviously missing, but I also wouldn't have known to add these. But this looks like it'll make us behave more correctly and consistently.
Contributor
Author
|
Thanks for the review. It's always really hard to know if you've actually solved the issues behind a flaky test. Hopefully, this will help. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This commit addresses various test flakiness:
deregisterDatabase. This method will remove the database from the currently running query server. If there is no query server, then there is nothing to remove. So, this error is safe to ignore.end()a connectionServerProcess. I'm not 100% sure if this is necessary, but it seems like it prevents responses from being handled and erroring out.CodeQL: Restart Query Servertwice in a row, you would get an error from the ideServer restart. Restart fails if the server is not already started. So, in this case just call a start.