Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/famedly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ jobs:
run: until pg_isready -h localhost; do sleep 1; done
# coverage is already installed from the pyproject.toml file
- run: poetry run pip install coverage-enable-subprocess
- run: poetry run coverage run -m twisted.trial -j6 tests
# Normally, this Github runner has 2 cores(actually threads) available to it.
# Using only one trial test runner does not saturate the cpu. Rough experimentation in the past led to having 3
# of these runners per core as optimal, but now coverage is required and there may be the need
# to scale back a little. This should be 6 trial test runners/jobs
- run: poetry run coverage run -m twisted.trial -j$((`nproc` * 3 )) tests
env:
SYNAPSE_POSTGRES: ${{ matrix.job.database == 'postgres' || '' }}
SYNAPSE_POSTGRES_HOST: /var/run/postgresql
Expand Down
7 changes: 5 additions & 2 deletions tests/handlers/test_worker_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ def test_wait_for_lock_locally(self) -> None:
def test_lock_contention(self) -> None:
"""Test lock contention when a lot of locks wait on a single worker"""

# It takes around 0.5s on a 5+ years old laptop
with test_timeout(5):
# It takes around 0.5s on a 5+ years old laptop when tests are not heavily
# concurrent. The database load(even with sqlite in memory) seems to hit a wall
# after `nproc` * 4 number of jobs. Increasing the timeout allows all the
# database reads/writes to actually complete
with test_timeout(15):
nb_locks = 500
d = self._take_locks(nb_locks)
self.assertEqual(self.get_success(d), nb_locks)
Expand Down
7 changes: 4 additions & 3 deletions tests/rest/admin/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import hmac
import json
import os
import time
import urllib.parse
from binascii import unhexlify
from http import HTTPStatus
Expand Down Expand Up @@ -5531,12 +5530,14 @@ def test_redact_messages_all_rooms(self) -> None:
id = channel.json_body.get("redact_id")

timeout_s = 10
start_time = time.time()
start_time = self.clock.time()
redact_result = ""
while redact_result != "complete":
if start_time + timeout_s < time.time():
if start_time + timeout_s < self.clock.time():
self.fail("Timed out waiting for redactions.")

# It's a background task, give it a shot at actually finishing
self.pump()
channel2 = self.make_request(
"GET",
f"/_synapse/admin/v1/user/redact_status/{id}",
Expand Down
Loading