-
Notifications
You must be signed in to change notification settings - Fork 52
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
Deflake leave-via-kick/ban faster joins tests #628
Conversation
We need to allow the homeserver under test to finish making requests to the Complement homeserver before tearing it down, otherwise the homeserver under test may mark the hostname:port combination as down and refuse to contact it in subsequent tests. Signed-off-by: Sean Quah <seanq@matrix.org>
// Dirty hack to allow the homeserver under test to finish making requests to the | ||
// Complement homeserver as part of syncing the full state. | ||
psjResult.AwaitStateIdsRequest(t) | ||
time.Sleep(time.Second / 2) |
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.
This is incredibly hacky. Alternative suggestions welcome.
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.
Top of my head: we could make the homeserver under test take an action in the room that requires knowledge of the full state, and wait for complement's HS to see it. (Is there an example of a federation API that blocks on full state?)
(Personally I can live with the hack though)
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.
I think the difficulty is that the homeserver under test leaves the room independently of, and before the sync process finishes. Any request we might try would be met with a not-in-the-room response even though the sync process may still be running.
Should we add some kind of escape hatch for this? E.g. an admin API which could be used to mark a destination as up, that complement could call whenever a test begins? (Not ideal, but we seem to hit this class of flake a lot...) |
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.
Arg, this is one of my tests. I think we did talk about it at the time but clearly I missed this class of flakes/interaction with other tests---sorry.
// Dirty hack to allow the homeserver under test to finish making requests to the | ||
// Complement homeserver as part of syncing the full state. | ||
psjResult.AwaitStateIdsRequest(t) | ||
time.Sleep(time.Second / 2) |
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.
Top of my head: we could make the homeserver under test take an action in the room that requires knowledge of the full state, and wait for complement's HS to see it. (Is there an example of a federation API that blocks on full state?)
(Personally I can live with the hack though)
We could do. It's very Synapse and faster joins test-specific though. We only hit this class of flake because we reuse the same Synapse with lots of different Complement instances in the faster joins test suite. |
We need to allow the homeserver under test to finish making requests to
the Complement homeserver before tearing it down, otherwise the
homeserver under test may mark the hostname:port combination as down and
refuse to contact it in subsequent tests.
Signed-off-by: Sean Quah seanq@matrix.org
NB: you can tease out the flakes by forcing Complement to reuse ports whenever possible: