Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack around a race in the partial-state tests #456

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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