Deflake faster joins device list tests by waiting for leave event#627
Merged
Deflake faster joins device list tests by waiting for leave event#627
Conversation
Contributor
Author
|
CI flaked due to the issue fixed by #628. |
added 4 commits
March 15, 2023 10:44
Some of the faster joins tests have two Complement homeservers in the same room. We need both Complement homeservers to believe they are in the room, so that we can wait to observe a leave for the test user as part of test cleanup. The easiest way to do this is to have the second Complement homeserver perform a real join. Signed-off-by: Sean Quah <seanq@matrix.org>
This is useful for setting up tests with two Complement homeservers in the same room by having one of them join off the other. Signed-off-by: Sean Quah <seanq@matrix.org>
...so that we can wait for the homeserver under test to send us leave events during test cleanup. Signed-off-by: Sean Quah <seanq@matrix.org>
This depends on the second Complement homeserver believing it is joined to the test room. Signed-off-by: Sean Quah <seanq@matrix.org>
632ac7b to
926a40f
Compare
DMRobertson
approved these changes
Mar 16, 2023
Contributor
DMRobertson
left a comment
There was a problem hiding this comment.
Looks like this was painful to diagnose; thank you for persisting.
| // MustJoinRoom will make the server send a make_join and a send_join to join a room | ||
| // It returns the resultant room. | ||
| func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string) *ServerRoom { | ||
| func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string, partialState ...bool) *ServerRoom { |
Contributor
There was a problem hiding this comment.
I guess this is go's idiom for an optional argument? Feels a bit odd to allow an arbitrary length array/slice, but I guess it's easier than updating every call site?
Contributor
Author
There was a problem hiding this comment.
Not sure actually. Functional varargs (https://stackoverflow.com/a/26326418) is the pattern MustDoFunc uses. Here I didn't bother with them since there's only one optional argument.
This was
linked to
issues
Mar 16, 2023
Contributor
|
(I've optimistically marked this as closing a bunch of faster join device list updates tests---hope I correctly matched up tests to this issue) |
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.
Many of the faster joins test flakes are due to the homeserver under
test failing to contact Complement homeservers after they have been
torn down. When this happens, subsequent tests can fail if they use a
Complement homeserver that happens to have the same hostname:port as one
which the homeserver under test has previously marked as offline.
Wait for the homeserver under test to finish broadcasting its leave at
the end of the device list tests.
Signed-off-by: Sean Quah seanq@matrix.org
Builds on top of #626.
Reviewable commit by commit.
NB: you can tease out the flakes by forcing Complement to reuse ports whenever possible: