summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-25 16:33:40 +0100
committerGitHub <noreply@github.com>2018-10-25 16:33:40 +0100
commit95ad12885134ab1cdd0b21f1e0274e588220f681 (patch)
tree754bb889ef44463125e6dc9c4dceb07c9949fa81 /tests
parentMerge pull request #3975 from matrix-org/matthew/autocreate_autojoin (diff)
parentadd new line (diff)
downloadsynapse-95ad12885134ab1cdd0b21f1e0274e588220f681.tar.xz
Merge pull request #4081 from matrix-org/neilj/fix_mau_init
fix race condiftion in calling initialise_reserved_users
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_monthly_active_users.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/storage/test_monthly_active_users.py b/tests/storage/test_monthly_active_users.py
index 686f12a0dc..832e379a83 100644
--- a/tests/storage/test_monthly_active_users.py
+++ b/tests/storage/test_monthly_active_users.py
@@ -52,7 +52,10 @@ class MonthlyActiveUsersTestCase(HomeserverTestCase):
         now = int(self.hs.get_clock().time_msec())
         self.store.user_add_threepid(user1, "email", user1_email, now, now)
         self.store.user_add_threepid(user2, "email", user2_email, now, now)
-        self.store.initialise_reserved_users(threepids)
+
+        self.store.runInteraction(
+            "initialise", self.store._initialise_reserved_users, threepids
+        )
         self.pump()
 
         active_count = self.store.get_monthly_active_count()
@@ -199,7 +202,10 @@ class MonthlyActiveUsersTestCase(HomeserverTestCase):
             {'medium': 'email', 'address': user2_email},
         ]
         self.hs.config.mau_limits_reserved_threepids = threepids
-        self.store.initialise_reserved_users(threepids)
+        self.store.runInteraction(
+            "initialise", self.store._initialise_reserved_users, threepids
+        )
+
         self.pump()
         count = self.store.get_registered_reserved_users_count()
         self.assertEquals(self.get_success(count), 0)