From 1fe64531c0f147c8cad2ed89d4e518c22b36c216 Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Tue, 14 Mar 2023 16:21:07 +0000 Subject: [PATCH] Deflake leave-via-kick/ban faster joins tests We need to allow the homeserver under test to finish making requests to the Complement homeserver before tearing it down, otherwise the homeserver under test may mark the hostname:port combination as down and refuse to contact it in subsequent tests. Signed-off-by: Sean Quah --- tests/federation_room_join_partial_state_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/federation_room_join_partial_state_test.go b/tests/federation_room_join_partial_state_test.go index 9ed3d78b..d383ca46 100644 --- a/tests/federation_room_join_partial_state_test.go +++ b/tests/federation_room_join_partial_state_test.go @@ -3718,6 +3718,10 @@ func TestPartialStateJoin(t *testing.T) { // Cleanup. psjResult.FinishStateRequest() + // Dirty hack to allow the homeserver under test to finish making requests to the + // Complement homeserver as part of syncing the full state. + psjResult.AwaitStateIdsRequest(t) + time.Sleep(time.Second / 2) }) t.Run("can be triggered by remote ban", func(t *testing.T) { @@ -3781,6 +3785,10 @@ func TestPartialStateJoin(t *testing.T) { // Cleanup. psjResult.FinishStateRequest() + // Dirty hack to allow the homeserver under test to finish making requests to the + // Complement homeserver as part of syncing the full state. + psjResult.AwaitStateIdsRequest(t) + time.Sleep(time.Second / 2) }) })