Skip to content

Commit 2844152

Browse files
authored
Fix incorrect refactor of Leave during resync faster joins test (#629)
We need to start expecting leave events before the test user leaves the room, not after. Signed-off-by: Sean Quah <[email protected]>
1 parent 6f41799 commit 2844152

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/federation_room_join_partial_state_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,14 +3602,6 @@ func TestPartialStateJoin(t *testing.T) {
36023602
)
36033603

36043604
t.Log("Alice leaves and waits for confirmation")
3605-
alice.LeaveRoom(t, serverRoom.RoomID)
3606-
aliceNextBatch = alice.MustSyncUntil(
3607-
t,
3608-
client.SyncReq{Since: aliceNextBatch, Filter: buildLazyLoadingSyncFilter(nil)},
3609-
client.SyncLeftFrom(alice.UserID, serverRoom.RoomID),
3610-
)
3611-
3612-
t.Logf("Alice's leave is received by the resident server")
36133605
// Prepare to listen for leave events from the HS under test.
36143606
// We're only expecting one leave event, but give the channel extra capacity
36153607
// to avoid deadlock if the HS does something silly.
@@ -3630,6 +3622,14 @@ func TestPartialStateJoin(t *testing.T) {
36303622
return true
36313623
},
36323624
)
3625+
alice.LeaveRoom(t, serverRoom.RoomID)
3626+
aliceNextBatch = alice.MustSyncUntil(
3627+
t,
3628+
client.SyncReq{Since: aliceNextBatch, Filter: buildLazyLoadingSyncFilter(nil)},
3629+
client.SyncLeftFrom(alice.UserID, serverRoom.RoomID),
3630+
)
3631+
3632+
t.Logf("Alice's leave is received by the resident server")
36333633
select {
36343634
case <-time.After(1 * time.Second):
36353635
t.Fatal("Resident server did not receive Alice's leave")

0 commit comments

Comments
 (0)