synapse/tests
Eric Eastwood 5adb08f3c9
Remove MockClock() (#18992)
Spawning from adding some logcontext debug logs in
https://github.com/element-hq/synapse/pull/18966 and since we're not
logging at the `set_current_context(...)` level (see reasoning there),
this removes some usage of `set_current_context(...)`.

Specifically, `MockClock.call_later(...)` doesn't handle logcontexts
correctly. It uses the calling logcontext as the callback context
(wrong, as the logcontext could finish before the callback finishes) and
it didn't reset back to the sentinel context before handing back to the
reactor. It was like this since it was [introduced 10+ years
ago](38da9884e7).
Instead of fixing the implementation which would just be a copy of our
normal `Clock`, we can just remove `MockClock`
2025-09-30 11:27:29 -05:00
..
api Update MSC4326 error code (#18947) 2025-09-24 11:57:24 +01:00
app Split loading config vs homeserver setup (#18933) 2025-09-22 14:53:02 -05:00
appservice Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
config Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
crypto Fix server_name in logging context for multiple Synapse instances in one process (#18868) 2025-09-26 17:10:48 -05:00
events Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
federation Fix server_name in logging context for multiple Synapse instances in one process (#18868) 2025-09-26 17:10:48 -05:00
handlers Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
http Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
logging Fix server_name in logging context for multiple Synapse instances in one process (#18868) 2025-09-26 17:10:48 -05:00
media Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
metrics Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
module_api Document and fix room_config param when user_may_create_room callback is invoked for a room upgrade (#18721) 2025-09-24 21:42:19 +00:00
push Remove sentinel logcontext in Clock utilities (looping_call, looping_call_now, call_later) (#18907) 2025-09-22 14:51:13 -05:00
replication Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
rest Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
scripts Update license headers 2023-11-21 15:29:58 -05:00
server_notices Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
state Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
storage Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
test_utils Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
types Support for room version 12 2025-08-11 16:43:45 +01:00
util Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
server.py Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
test_distributor.py Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
test_event_auth.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_mau.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_phone_home.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_rust.py
test_server.py Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
test_state.py Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
test_terms_auth.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_types.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_visibility.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
unittest.py Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00
utils.py Remove MockClock() (#18992) 2025-09-30 11:27:29 -05:00