-
-
Notifications
You must be signed in to change notification settings - Fork 367
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 boot def test #2686
Fix flaky boot def test #2686
Conversation
Good catch, Re 9.0.2, I have seen this test fail in the 9.2.1 branch as well, so it's just timing issues. |
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.
Thank you!!!
Can we get a comment in the code? It's a bit non-obvious what's going on there for future people. Is there something systematic we should be doing to make this happen less often? Should we alter |
Yeah, I'll add a comment.
The Something that might be better in some cases is a So maybe waitForMsgSet :: NonEmptyList (FromServerMessage -> Bool) -> Session (NonEmptyList FromServerMessage) and a bunch of predicates defined for common types like the hover response, definition response etc. The idea is that it will wait for all of these predicates to be true in any order, and return messages corresponding to each predicate in the same order as the predicates were listed. Not sure if this is idiomatic regarding the parser type, maybe there is a higher level of doing the same thing, but I think something like this would be convenient. Then after maybe the |
I don't really know enough about how the tests are written to say, but I encourage you to keep thinking about it! |
Should fix #2677
I could not reproduce it locally, but I found in the logs that it is possible for
getHover
to eat aghcide/reference/ready
custom message. If that happens theskipManyTill
ghcide/references/ready
will be starving until timeout. Not sure why this happens more often (or only?) on the 9.0.2 ubuntu-latest tests.The fix skips messages until the hover response or
ghcide/reference/ready
, and depending on which was received skips messages until receiving the other.In all the other places I could find where something similar happens they either do
getHover
orskipManyTill
ghcide/references/ready
but not both, and so that's why we don't see these problems in other tests.As a side note at first I didn't realize more than one ghcide process was being run so the logs were very confusing.