summaryrefslogtreecommitdiff
path: root/docs/topics/testing
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2024-12-11 00:37:49 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2025-02-16 07:58:15 +0100
commitdc69a63f844b2ef3bc3371edde91644cf0bef0ee (patch)
treeb5f54b0860cfa5e97b6a94ead8907751849194bd /docs/topics/testing
parentdf2c4952df6d93c575fb8a3c853dc9d4c2449f36 (diff)
Fixed #35967 -- Deferred test suite fixtures serialization after all dbs setup.
While the top-level objects fed to serialization are bound to the test database being created nothing prevents code invoked during serialization from performing queries against other connections entries that haven't been swapped yet. The reported example of that is a database router directing all reads to a test mirror for a set of models involving auto-created many-to-many fields. It might be tempting to address the many-to-many field case but this a symptom of a larger problem where the test framework yields the flow execution to user code that could interact with non-test databases in unexpected ways. Deferring test database fixture serialization until the point where all connections entries have been swapped for their test equivalent ensures that no code triggered during serialization can interact with non-test databases. Thanks Jake Howard for the report and Jacob Walls for the initial investigation.
Diffstat (limited to 'docs/topics/testing')
0 files changed, 0 insertions, 0 deletions