Skip to content

Commit

Permalink
Use MustSyncUntil to avoid a race
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jan 23, 2023
1 parent 70f58ac commit 76d2e5c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/federation_room_join_partial_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,11 @@ func TestPartialStateJoin(t *testing.T) {
psjResult.FinishStateRequest()

// the /sync request should now complete, with the new room
response, _ = alice.MustSync(t, client.SyncReq{Since: nextBatch})

if !response.Get(syncJoinedRoomPath).Exists() {
t.Fatal("Sync should now include the joined room since resync is over")
}
nextBatch = alice.MustSyncUntil(
t,
client.SyncReq{Since: nextBatch},
client.SyncJoinedTo(alice.UserID, serverRoom.RoomID),
)
})

// test that a partial-state join can fall back to other homeservers when re-syncing
Expand Down Expand Up @@ -1187,11 +1187,11 @@ func TestPartialStateJoin(t *testing.T) {
// reply to hs2 with a bogus /state_ids response
fedStateIdsSendResponseWaiter.Finish()

response, _ = charlie.MustSync(t, client.SyncReq{Since: nextBatch})

if !response.Get(syncJoinedRoomPath).Exists() {
t.Fatal("hs2 /sync completed without join to new room")
}
nextBatch = charlie.MustSyncUntil(
t,
client.SyncReq{Since: nextBatch},
client.SyncJoinedTo(charlie.UserID, roomID),
)
})

// test a lazy-load-members sync while re-syncing partial state, followed by completion of state syncing,
Expand Down

0 comments on commit 76d2e5c

Please sign in to comment.