mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Add sync mechanism to block when updating device lists (#1264)
* Add sync mechanism to block when updating device lists With a timeout, mainly for sytest to fix the test "Server correctly handles incoming m.device_list_update" which is flakey because it assumes that when `/send` 200 OKs that the server has updated the device lists in prep for `/keys/query` which is not always true when using workers. * Fix UT * Add new working test
This commit is contained in:
parent
0835107f5b
commit
d98ec12422
3 changed files with 46 additions and 16 deletions
|
@ -204,16 +204,6 @@ func TestUpdateNoPrevID(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("Update returned an error: %s", err)
|
||||
}
|
||||
// At this point we show have this device list marked as stale and not store the keys or emitted anything
|
||||
if !db.staleUsers[event.UserID] {
|
||||
t.Errorf("%s not marked as stale", event.UserID)
|
||||
}
|
||||
if len(producer.events) > 0 {
|
||||
t.Errorf("Update incorrect emitted %d device change events", len(producer.events))
|
||||
}
|
||||
if len(db.storedKeys) > 0 {
|
||||
t.Errorf("Update incorrect stored %d device change events", len(db.storedKeys))
|
||||
}
|
||||
t.Log("waiting for /users/devices to be called...")
|
||||
wg.Wait()
|
||||
// wait a bit for db to be updated...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue