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

Fix flakey key upload test #649

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Sep 5, 2023

We waited for the device list update to come down sync before calling /keys/query. However, the update going down sync occasionally was for the initial key upload, and so the call to /keys/query would return the old key and the test would fail.

To fix that, wait for the initial key to come down sync, and then run the test.

Closes matrix-org/synapse#16020 (maybe?)

Comment on lines +90 to +97
devicesChanged := topLevelSyncJSON.Get("device_lists.changed")
if devicesChanged.Exists() {
for _, userID := range devicesChanged.Array() {
if userID.Str == alice.UserID {
return nil
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

there might be some clever way to use JSONCheckOffAllowUnwanted here but I usually find that more confusing tbh

Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Thanks! Let's try it

@erikjohnston erikjohnston merged commit fdb9131 into main Sep 5, 2023
4 checks passed
@erikjohnston erikjohnston deleted the erikj/fix_flakey_device_query branch September 5, 2023 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complement flake TestFederationKeyUploadQuery/Parallel/Can_query_remote_device_keys_using_POST
2 participants