Skip to content
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 TestRestrictedRoomsRemoteJoinFailOver flake due to race #614

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions tests/restricted_rooms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,10 @@ func doTestRestrictedRoomsRemoteJoinFailOver(t *testing.T, roomVersion string, j
// Charlie leaves the room (so they can rejoin).
charlie.LeaveRoom(t, room)

// Ensure the events have synced to hs2.
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncTimelineHas(
room,
func(ev gjson.Result) bool {
if ev.Get("type").Str != "m.room.member" || ev.Get("state_key").Str != charlie.UserID {
return false
}
return ev.Get("content").Get("membership").Str == "leave"
},
))
// Ensure the events have synced to hs1 and hs2, otherwise the joins below may
// happen before the leaves, from the perspective of hs1 and hs2.
alice.MustSyncUntil(t, client.SyncReq{}, client.SyncLeftFrom(charlie.UserID, room))
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncLeftFrom(charlie.UserID, room))

// Bob leaves the allowed room so that hs2 doesn't know if Charlie is in the
// allowed room or not.
Expand Down