Files
synapse/tests
Erik JohnstonandClaude Fable 5 a3505adf5f Characterization tests for logcontext error messages and the filter
Pin down behaviour that later refactors (notably porting the switch machinery
to Rust) must preserve but which the suite didn't yet cover:

 - the exact `logcontext_error` message shapes and the conditions that trigger
   them: wrong previous context on enter; lost/mismatched context on exit and
   in PreserveLoggingContext; start/stop on the wrong thread; re-starting a
   finished or already-active context; stop without a recorded start.
 - LoggingContextFilter: fills record attributes from a real logcontext, and
   under the sentinel only sets defaults for attributes not already present
   (the `safe_set` no-clobber contract that 3rd-party log records rely on).

These strings are load-bearing for downstream log scraping, so we assert them
verbatim (reconstructing `%r` interpolations from the same live objects rather
than hard-coding addresses).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LnJSXQ86AAWNtihR4C5PH
2026-07-15 13:25:27 +00:00
..
2026-06-02 11:05:38 +01:00