summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-17 13:58:40 +0100
committerNeil Johnson <neil@matrix.org>2018-08-17 13:58:40 +0100
commit9fd161c6fb93d2ab2d297e5190e1faaebbd7c892 (patch)
treef0439ed7a668a2b0d627b78aaab25b03a2fb6514 /tests
parentserver limits config docs (diff)
parentMerge branch 'develop' into neilj/limit_exceeded_error (diff)
downloadsynapse-9fd161c6fb93d2ab2d297e5190e1faaebbd7c892.tar.xz
Merge branch 'neilj/limit_exceeded_error' of github.com:matrix-org/synapse into neilj/limit_exceeded_error
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_monthly_active_users.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/storage/test_monthly_active_users.py b/tests/storage/test_monthly_active_users.py
index 511acbde9b..f2ed866ae7 100644
--- a/tests/storage/test_monthly_active_users.py
+++ b/tests/storage/test_monthly_active_users.py
@@ -75,6 +75,19 @@ class MonthlyActiveUsersTestCase(tests.unittest.TestCase):
         active_count = yield self.store.get_monthly_active_count()
         self.assertEquals(active_count, user_num)
 
+        # Test that regalar users are removed from the db
+        ru_count = 2
+        yield self.store.upsert_monthly_active_user("@ru1:server")
+        yield self.store.upsert_monthly_active_user("@ru2:server")
+        active_count = yield self.store.get_monthly_active_count()
+
+        self.assertEqual(active_count, user_num + ru_count)
+        self.hs.config.max_mau_value = user_num
+        yield self.store.reap_monthly_active_users()
+
+        active_count = yield self.store.get_monthly_active_count()
+        self.assertEquals(active_count, user_num)
+
     @defer.inlineCallbacks
     def test_can_insert_and_count_mau(self):
         count = yield self.store.get_monthly_active_count()