From 68fdb85655a98f479824ff66e3f6cfe63e71ff58 Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Thu, 16 Mar 2023 12:50:02 +0000 Subject: [PATCH] Fix incorrect refactor of Leave during resync faster joins test We need to start expecting leave events before the test user leaves the room, not after. Signed-off-by: Sean Quah --- tests/federation_room_join_partial_state_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/federation_room_join_partial_state_test.go b/tests/federation_room_join_partial_state_test.go index f66a56ae..5e18f1d7 100644 --- a/tests/federation_room_join_partial_state_test.go +++ b/tests/federation_room_join_partial_state_test.go @@ -3553,14 +3553,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. @@ -3581,6 +3573,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")