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

Commit

Permalink
Don't rebuild the dir in tests that don't need it
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
David Robertson committed Sep 28, 2021
1 parent 18deeff commit 1112098
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/handlers/test_user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,20 +456,6 @@ def test_initial_share_all_users(self):
self.register_user("user2", "pass")
u3 = self.register_user("user3", "pass")

# Wipe the user dir
self.get_success(self.store.update_user_directory_stream_pos(None))
self.get_success(self.store.delete_all_from_user_dir())

# Do the initial population of the user directory via the background update
self._add_background_updates()

while not self.get_success(
self.store.db_pool.updates.has_completed_background_updates()
):
self.get_success(
self.store.db_pool.updates.do_next_background_update(100), by=0.1
)

shares_private = self.get_success(
self.user_dir_helper.get_users_who_share_private_rooms()
)
Expand Down Expand Up @@ -538,15 +524,6 @@ def test_prefer_local_users(self):
local_users = [local_user_1, local_user_2, local_user_3]
remote_users = [remote_user_1, remote_user_2, remote_user_3]

# Populate the user directory via background update
self._add_background_updates()
while not self.get_success(
self.store.db_pool.updates.has_completed_background_updates()
):
self.get_success(
self.store.db_pool.updates.do_next_background_update(100), by=0.1
)

# The local searching user searches for the term "user", which other users have
# in their user id
results = self.get_success(
Expand Down

0 comments on commit 1112098

Please sign in to comment.