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

Fix flaky shadow ban tests -- do not add a delay in tests. #8152

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8152.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for shadow-banning users (ignoring any message send requests).
4 changes: 3 additions & 1 deletion tests/rest/client/v1/test_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import json
from urllib import parse as urlparse

from mock import Mock
from mock import Mock, patch

import synapse.rest.admin
from synapse.api.constants import EventContentFields, EventTypes, Membership
Expand Down Expand Up @@ -1976,6 +1976,8 @@ def test_bad_alias(self):
self._set_canonical_alias({"alt_aliases": ["@unknown:test"]}, expected_code=400)


# To avoid the tests timing out don't add a delay to "annoy the requester".
@patch("random.randint", new=lambda a, b: 0)
class ShadowBannedTestCase(unittest.HomeserverTestCase):
servlets = [
synapse.rest.admin.register_servlets_for_client_rest_resource,
Expand Down