Files
synapse/tests
Erik JohnstonandClaude Opus 4.8 7d03de9a07 Commit id-generator construction in the multi-writer id-gen tests
Constructing a `MultiWriterIdGenerator` prunes stale `stream_positions` rows for
writers no longer in the config. The test harness built each generator inside a
`runWithConnection` callback and never committed, so that cleanup only persisted
because adbapi keeps one connection per thread and leaves its transaction open
across calls — a later generator on the same thread then saw the uncommitted
delete.

The native Rust pool hands out a fresh connection per call and rolls back any
left mid-transaction, so the cleanup was lost and test_writer_config_change read
a stale writer position (persisted-upto 3 instead of 6). Commit the connection
after constructing the generator, so the cleanup persists regardless of pool
semantics; the delete is legitimate work that should be committed anyway.

Fixes test_writer_config_change on the Rust backend; psycopg2 and sqlite still
pass (16/16 on both).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W3G4M92AmwSSZCbmtMJU3d
2026-07-06 10:14:31 +00:00
..
2026-06-02 11:05:38 +01:00