synapse/tests/storage/databases/main
Erik Johnston b74c29f694
Move towards a dedicated Duration class (#19223)
We have various constants to try and avoid mistyping of durations, e.g.
`ONE_HOUR_SECONDS * MILLISECONDS_PER_SECOND`, however this can get a
little verbose and doesn't help with typing.

Instead, let's move towards a dedicated `Duration` class (basically a
[`timedelta`](https://docs.python.org/3/library/datetime.html#timedelta-objects)
with helper methods).

This PR introduces the new types and converts all usages of the existing
constants with it. Future PRs may work to move the clock methods to also
use it (e.g. `call_later` and `looping_call`).

Reviewable commit-by-commit.
2025-11-26 10:56:59 +00:00
..
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_cache.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_deviceinbox.py Move towards a dedicated Duration class (#19223) 2025-11-26 10:56:59 +00:00
test_end_to_end_keys.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_events_worker.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_lock.py Fix server_name in logging context for multiple Synapse instances in one process (#18868) 2025-09-26 17:10:48 -05:00
test_metrics.py Refactor GaugeBucketCollector metrics to be homeserver-scoped (#18715) 2025-07-29 11:46:21 -05:00
test_receipts.py Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
test_room.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00