synapse/tests
gui-yue 07468a0f1c
Increase timeout for test_lock_contention on RISC-V (#18430)
This PR addresses a test failure for
`tests.handlers.test_worker_lock.WorkerLockTestCase.test_lock_contention`
which consistently times out on the RISC-V (specifically `riscv64`)
architecture.

The test simulates high lock contention and has a default timeout of 5
seconds, which seems sufficient for architectures like x86_64 but proves
too short for current RISC-V hardware/environment performance
characteristics, leading to spurious `tests.utils.TestTimeout` failures.

This fix introduces architecture detection using `platform.machine()`.
If a RISC-V architecture is detected:
* The timeout for this specific test is increased (e.g., to 15 seconds
).

The original, stricter timeout (5 seconds) and lock count (500) are
maintained for all other architectures to avoid masking potential
performance regressions elsewhere.

This change has been tested locally on RISC-V, where the test now passes
reliably, and on x86_64, where it continues to pass with the original
constraints.

---

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [X] Pull request is based on the develop branch *(Assuming you based
it correctly)*
* [X] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
*(See below)*
* [X] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
*(Please run linters locally)*
2025-05-27 17:17:04 +00:00
..
api Slight performance increase when using the ratelimiter (#18369) 2025-04-29 14:08:22 +01:00
app Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
appservice Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
config Fix a couple type annotations in the RootConfig/Config (#18409) 2025-05-13 10:22:15 -05:00
crypto Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events Fix a couple type annotations in the RootConfig/Config (#18409) 2025-05-13 10:22:15 -05:00
federation Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
handlers Increase timeout for test_lock_contention on RISC-V (#18430) 2025-05-27 17:17:04 +00:00
http Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
logging Removal: Remove support for experimental msc3886 (#17638) 2024-11-13 14:10:20 +00:00
media Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
metrics Add a unit test for the phone home stats (#18463) 2025-05-20 16:26:45 +01:00
module_api Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
push Do not retry push during backoff period (#18363) 2025-04-29 14:08:11 +01:00
replication Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
rest Don't move invited users to new room when shutting down room (#18471) 2025-05-23 09:59:40 +01:00
scripts Update license headers 2023-11-21 15:29:58 -05:00
server_notices Sliding Sync: Add cache to get_tags_for_room(...) (#17730) 2024-09-19 12:43:26 +01:00
state Update license headers 2023-11-21 15:29:58 -05:00
storage Merge branch 'master' into develop 2025-05-20 09:36:05 -06:00
test_utils Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
types Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
util Cleanup Python 3.8 leftovers (#17967) 2025-02-10 16:53:24 +00:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
server.py Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
test_distributor.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_event_auth.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_mau.py Update license headers 2023-11-21 15:29:58 -05:00
test_phone_home.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_rust.py Add missing type hints to tests. (#15027) 2023-02-08 19:52:37 +00:00
test_server.py Removal: Remove support for experimental msc3886 (#17638) 2024-11-13 14:10:20 +00:00
test_state.py Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
test_terms_auth.py Update license headers 2023-11-21 15:29:58 -05:00
test_test_utils.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_types.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_visibility.py Include user membership on events (#17282) 2024-06-13 21:45:54 +00:00
unittest.py Cleanup Python 3.8 leftovers (#17967) 2025-02-10 16:53:24 +00:00
utils.py Cleanup Python 3.8 leftovers (#17967) 2025-02-10 16:53:24 +00:00