Skip to content

Commit

Permalink
Fix incorrect refactor of Leave during resync faster joins test (#629)
Browse files Browse the repository at this point in the history
We need to start expecting leave events before the test user leaves the
room, not after.

Signed-off-by: Sean Quah <seanq@matrix.org>
  • Loading branch information
squahtx authored Mar 16, 2023
1 parent 6f41799 commit 2844152
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/federation_room_join_partial_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3602,14 +3602,6 @@ func TestPartialStateJoin(t *testing.T) {
)

t.Log("Alice leaves and waits for confirmation")
alice.LeaveRoom(t, serverRoom.RoomID)
aliceNextBatch = alice.MustSyncUntil(
t,
client.SyncReq{Since: aliceNextBatch, Filter: buildLazyLoadingSyncFilter(nil)},
client.SyncLeftFrom(alice.UserID, serverRoom.RoomID),
)

t.Logf("Alice's leave is received by the resident server")
// Prepare to listen for leave events from the HS under test.
// We're only expecting one leave event, but give the channel extra capacity
// to avoid deadlock if the HS does something silly.
Expand All @@ -3630,6 +3622,14 @@ func TestPartialStateJoin(t *testing.T) {
return true
},
)
alice.LeaveRoom(t, serverRoom.RoomID)
aliceNextBatch = alice.MustSyncUntil(
t,
client.SyncReq{Since: aliceNextBatch, Filter: buildLazyLoadingSyncFilter(nil)},
client.SyncLeftFrom(alice.UserID, serverRoom.RoomID),
)

t.Logf("Alice's leave is received by the resident server")
select {
case <-time.After(1 * time.Second):
t.Fatal("Resident server did not receive Alice's leave")
Expand Down

0 comments on commit 2844152

Please sign in to comment.