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

De-flake MSC3030 backfill test with Synapse worker replication #492

Merged
Merged
Changes from 2 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
11 changes: 11 additions & 0 deletions tests/msc3030_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ func TestJumpToDateEndpoint(t *testing.T) {
contextResResBody := client.ParseJSON(t, contextRes)
Copy link
Contributor Author

@MadLittleMods MadLittleMods Oct 6, 2022

Choose a reason for hiding this comment

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

Fixes matrix-org/synapse#13944?

@squahtx I don't think this fixes that issue. The error there is:

msc3030_test.go:200: CSAPI.MustDoFunc response return non-2xx code: 403 Forbidden - body: {"errcode":"M_FORBIDDEN","error":"You don't have permission to access that event."}

which indicates we also need to retry the /context request above until it works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a separate PR: matrix-org/synapse#14096

paginationToken := client.GetJSONFieldStr(t, contextResResBody, "end")

// Hit `/messages` until `eventA` has been backfilled and replicated across
// workers (the worker persisting events isn't necessarily the same as the worker
// serving `/messages`)
fetchUntilMessagesResponseHas(t, remoteCharlie, roomID, func(ev gjson.Result) bool {
if ev.Get("event_id").Str == eventA.EventID {
return true
}

return false
MadLittleMods marked this conversation as resolved.
Show resolved Hide resolved
})

// Paginate backwards from eventB
messagesRes := remoteCharlie.MustDoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", roomID, "messages"}, client.WithContentType("application/json"), client.WithQueries(url.Values{
"dir": []string{"b"},
Expand Down