Skip to content

Commit

Permalink
Faster room joins: Fix bug in awaitPartialStateJoinCompletion (#487)
Browse files Browse the repository at this point in the history
`/sync` is not a good way to wait for a room to transition to full
state, since it only waits for the full state at particular events
instead of the whole room. This caused flakiness in the "Device list
updates no longer reach departed servers after partial state join
completes" test.

Use `/members` instead to wait for partial state joins to complete.
  • Loading branch information
squahtx authored Oct 3, 2022
1 parent 0b0545b commit 0b7d990
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/federation_room_join_partial_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ func TestPartialStateJoin(t *testing.T) {
) {
t.Helper()

user.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(user.UserID, room.RoomID))
// Use a `/members` request to wait for the room to be un-partial stated.
// We avoid using `/sync`, as it only waits (or used to wait) for full state at
// particular events, rather than the whole room.
user.MustDoFunc(
t,
"GET",
[]string{"_matrix", "client", "v3", "rooms", room.RoomID, "members"},
)
t.Logf("%s's partial state join to %s completed.", user.UserID, room.RoomID)
}

Expand Down

0 comments on commit 0b7d990

Please sign in to comment.