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 TestDeviceListUpdates flakes #593

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

squahtx
Copy link
Contributor

@squahtx squahtx commented Feb 1, 2023

When a remote user has a device list update, an entry is expected to appear in
device_lists.changed in the /sync response. The local homeserver may then
query the remote homeserver for the update. Some homeservers (Synapse) may emit
extra device_lists.changed updates in /sync responses after querying keys.

Previously, we attempted to skip over the spurious device_lists.changed
updates by doing another sync. This wasn't sufficient, so we make another
remote user send a device list update, and wait for that to appear.

Fixes #580.

Signed-off-by: Sean Quah [email protected]


Fixes matrix-org/synapse#14103.

When a remote user has a device list update, an entry is expected to appear in
`device_lists.changed` in the `/sync` response. The local homeserver may then
query the remote homeserver for the update. Some homeservers (Synapse) may emit
extra `device_lists.changed` updates in `/sync` responses after querying keys.

Previously, we attempted to skip over the spurious `device_lists.changed`
updates by doing another sync. This wasn't sufficient, so we make another
remote user send a device list update, and wait for that to appear.

Fixes #580.

Signed-off-by: Sean Quah <[email protected]>
@squahtx squahtx requested review from a team as code owners February 1, 2023 05:40
) func(t *testing.T, nextBatch string) string {
t.Helper()

barry := deployment.RegisterUser(t, otherHSName, generateLocalpart("barry"), "password", false)
Copy link
Contributor

Choose a reason for hiding this comment

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

excellent choice of username :)

Comment on lines +109 to +110
// The barrier tries to ensure that `device_lists.changed` entries resulting from device list
// updates and queries before the barrier do not appear in `/sync` responses after the barrier.
Copy link
Contributor

Choose a reason for hiding this comment

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

Have I understood this correctly?

We make something new happen in the device lists stream for barry and wait to see the result happen. Because

  • barry's change happens after any "no-op" device_list.changed entries, and
  • the device list stream is sequential/linear(?)

by the time we've seen device_lists.changed for barry we will have already seen the "no-op" `device_list.changed" (if it was generated at all).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the idea, yes.

@clokep clokep removed the request for review from a team February 1, 2023 13:18
@squahtx squahtx merged commit 02c5e37 into main Feb 1, 2023
@squahtx squahtx deleted the squah/fix_device_lists_tests_flakes branch February 1, 2023 19:58
@squahtx squahtx self-assigned this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants