Skip to content

Commit 9cbfa08

Browse files
authored
Faster room joins: Deflake events-arriving-before-prev_events test (#490)
Synapse can take a while to persist 100 outliers. Instead of doing one big wait for the last outlier to be persisted, do some smaller waits for intermediate outliers and a small wait for the last outlier. ie. as long as the homeserver under test is making progress, we are happy to continue waiting.
1 parent d2fee99 commit 9cbfa08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/federation_room_join_partial_state_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,12 @@ func TestPartialStateJoin(t *testing.T) {
919919
i += len(transactionEvents)
920920
}
921921

922-
// wait for the last outlier to arrive
923-
awaitEventArrival(t, 10*time.Second, alice, serverRoom.RoomID, outliers[len(outliers)-1].EventID())
922+
// wait for the outliers to arrive
923+
for i := 0; i < len(outliers); i += 10 {
924+
awaitEventArrival(t, 5*time.Second, alice, serverRoom.RoomID, outliers[i].EventID())
925+
}
926+
// ...and wait for the last outlier to arrive
927+
awaitEventArrival(t, 5*time.Second, alice, serverRoom.RoomID, outliers[len(outliers)-1].EventID())
924928

925929
// release the federation /state response
926930
psjResult.FinishStateRequest()

0 commit comments

Comments
 (0)