From 9a88346cb3cfe2f03c56d0af0fc754bb4feb1e65 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 5 Jul 2021 18:01:46 +0100 Subject: [PATCH] Discovered why we need this wait here --- tests/app/test_phone_stats_home.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/app/test_phone_stats_home.py b/tests/app/test_phone_stats_home.py index 0a57b6ec18..a67c83fa74 100644 --- a/tests/app/test_phone_stats_home.py +++ b/tests/app/test_phone_stats_home.py @@ -40,8 +40,9 @@ class PhoneHomeTestCase(HomeserverTestCase): # Send a message (this counts as activity) self.helper.send(room_id, "message2", tok=access_token) - # TODO: Not sure why this needs 4+ seconds advancing here...? - self.reactor.advance(4) + # We have to wait up to 5 seconds for _update_client_ips_batch to get + # called and update the user_ips table in a batch. + self.reactor.advance(5.1) # *Now* the user is counted. r30_results = self.get_success(self.hs.get_datastore().count_r30_users())