Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 1112098

Browse files
author
David Robertson
committed
Don't rebuild the dir in tests that don't need it
In #10796 I changed registering a user to add directory entries under. This means we don't have to force a directory regbuild in to tests of the user directory search.
1 parent 18deeff commit 1112098

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

tests/handlers/test_user_directory.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -456,20 +456,6 @@ def test_initial_share_all_users(self):
456456
self.register_user("user2", "pass")
457457
u3 = self.register_user("user3", "pass")
458458

459-
# Wipe the user dir
460-
self.get_success(self.store.update_user_directory_stream_pos(None))
461-
self.get_success(self.store.delete_all_from_user_dir())
462-
463-
# Do the initial population of the user directory via the background update
464-
self._add_background_updates()
465-
466-
while not self.get_success(
467-
self.store.db_pool.updates.has_completed_background_updates()
468-
):
469-
self.get_success(
470-
self.store.db_pool.updates.do_next_background_update(100), by=0.1
471-
)
472-
473459
shares_private = self.get_success(
474460
self.user_dir_helper.get_users_who_share_private_rooms()
475461
)
@@ -538,15 +524,6 @@ def test_prefer_local_users(self):
538524
local_users = [local_user_1, local_user_2, local_user_3]
539525
remote_users = [remote_user_1, remote_user_2, remote_user_3]
540526

541-
# Populate the user directory via background update
542-
self._add_background_updates()
543-
while not self.get_success(
544-
self.store.db_pool.updates.has_completed_background_updates()
545-
):
546-
self.get_success(
547-
self.store.db_pool.updates.do_next_background_update(100), by=0.1
548-
)
549-
550527
# The local searching user searches for the term "user", which other users have
551528
# in their user id
552529
results = self.get_success(

0 commit comments

Comments
 (0)