Skip to content

Commit

Permalink
Fix Sharded Media Repo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Nov 19, 2024
1 parent ff406f5 commit fc5d31c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/replication/test_multi_media_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.server import FakeChannel, FakeTransport, make_request
from tests.test_utils import SMALL_PNG
from tests.unittest import override_config

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -148,6 +149,7 @@ def _get_media_req(

return channel, request

@override_config({"enable_authenticated_media": False})
def test_basic(self) -> None:
"""Test basic fetching of remote media from a single worker."""
hs1 = self.make_worker_hs("synapse.app.generic_worker")
Expand All @@ -164,6 +166,7 @@ def test_basic(self) -> None:
self.assertEqual(channel.code, 200)
self.assertEqual(channel.result["body"], b"Hello!")

@override_config({"enable_authenticated_media": False})
def test_download_simple_file_race(self) -> None:
"""Test that fetching remote media from two different processes at the
same time works.
Expand Down Expand Up @@ -203,6 +206,7 @@ def test_download_simple_file_race(self) -> None:
# We expect only one new file to have been persisted.
self.assertEqual(start_count + 1, self._count_remote_media())

@override_config({"enable_authenticated_media": False})
def test_download_image_race(self) -> None:
"""Test that fetching remote *images* from two different processes at
the same time works.
Expand Down

0 comments on commit fc5d31c

Please sign in to comment.