Skip to content

Commit

Permalink
Hack around a race in the partial-state tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Aug 26, 2022
1 parent 53024b2 commit f648a55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/federation_room_join_partial_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,16 @@ func testReceiveEventDuringPartialStateJoin(
client.SyncJoinedTo(alice.UserID, psjResult.ServerRoom.RoomID),
)

// FIXME: if we try to do a /state_ids request immediately, it will race against update of the "current state", and
// our request may be rejected due to https://github.com/matrix-org/synapse/issues/13288.
// By way of a workaround, request a remote user's current membership, which should block until the current state
// is updated.
alice.DoFunc(
t,
"GET",
[]string{"_matrix", "client", "v3", "rooms", psjResult.ServerRoom.RoomID, "state", "m.room.member", "@non-existent:remote"},
)

// check the server's idea of the state at the event. We do this by making a `state_ids` request over federation
stateReq = gomatrixserverlib.NewFederationRequest("GET", "hs1",
fmt.Sprintf("/_matrix/federation/v1/state_ids/%s?event_id=%s",
Expand Down

0 comments on commit f648a55

Please sign in to comment.