synapse/tests/util
Eric Eastwood e7d98d3429
Remove sentinel logcontext in Clock utilities (looping_call, looping_call_now, call_later) (#18907)
Part of https://github.com/element-hq/synapse/issues/18905

Lints for ensuring we use `Clock.call_later` instead of
`reactor.callLater`, etc are coming in
https://github.com/element-hq/synapse/pull/18944

### Testing strategy

 1. Configure Synapse to log at the `DEBUG` level
1. Start Synapse: `poetry run synapse_homeserver --config-path
homeserver.yaml`
1. Wait 10 seconds for the [database profiling
loop](9cc4001778/synapse/storage/database.py (L711))
to execute
1. Notice the logcontext being used for the `Total database time` log
line

Before (`sentinel`):

```
2025-09-10 16:36:58,651 - synapse.storage.TIME - 707 - DEBUG - sentinel - Total database time: 0.646% {room_forgetter_stream_pos(2): 0.131%, reap_monthly_active_users(1): 0.083%, get_device_change_last_converted_pos(1): 0.078%}
```

After (`looping_call`):

```
2025-09-10 16:36:58,651 - synapse.storage.TIME - 707 - DEBUG - looping_call - Total database time: 0.646% {room_forgetter_stream_pos(2): 0.131%, reap_monthly_active_users(1): 0.083%, get_device_change_last_converted_pos(1): 0.078%}
```
2025-09-22 14:51:13 -05:00
..
caches Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_async_helpers.py Fix Twisted tests with latest release (#17911) 2024-11-07 16:22:09 +00:00
test_batching_queue.py Refactor Gauge metrics to be homeserver-scoped (#18725) 2025-07-29 10:37:59 -05:00
test_check_dependencies.py Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
test_dict_cache.py Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
test_events.py Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
test_expiring_cache.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_file_consumer.py Update license headers 2023-11-21 15:29:58 -05:00
test_itertools.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_linearizer.py Cleanup Python 3.8 leftovers (#17967) 2025-02-10 16:53:24 +00:00
test_logcontext.py Remove sentinel logcontext in Clock utilities (looping_call, looping_call_now, call_later) (#18907) 2025-09-22 14:51:13 -05:00
test_logformatter.py Update license headers 2023-11-21 15:29:58 -05:00
test_lrucache.py Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
test_macaroons.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_mutable_overlay_mapping.py Fix bug where sliding sync ignored room_id_to_include option (#18535) 2025-06-13 11:29:23 +01:00
test_ratelimitutils.py Refactor Counter metrics to be homeserver-scoped (#18656) 2025-07-25 14:58:47 -05:00
test_retryutils.py Refactor background process metrics to be homeserver-scoped (#18670) 2025-07-23 13:28:17 -05:00
test_rwlock.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_stream_change_cache.py Refactor cache metrics to be homeserver-scoped (#18604) 2025-07-16 16:04:57 -05:00
test_stringutils.py Implement MSC4133 to support custom profile fields. (#17488) 2025-01-21 11:11:04 +00:00
test_task_scheduler.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00
test_threepids.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_treecache.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_wheel_timer.py Fix WheelTimer implementation that can expired timeout early (#17850) 2024-11-05 12:08:17 -06:00