Skip to content
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
8 changes: 8 additions & 0 deletions tests/federation_room_join_partial_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +3721 to +3724
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incredibly hacky. Alternative suggestions welcome.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top of my head: we could make the homeserver under test take an action in the room that requires knowledge of the full state, and wait for complement's HS to see it. (Is there an example of a federation API that blocks on full state?)

(Personally I can live with the hack though)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the difficulty is that the homeserver under test leaves the room independently of, and before the sync process finishes. Any request we might try would be met with a not-in-the-room response even though the sync process may still be running.

})

t.Run("can be triggered by remote ban", func(t *testing.T) {
Expand Down Expand Up @@ -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)
})
})

Expand Down