Commit d5c4d29
committed
fix(api): Skip the test databases' serialized_rollback snapshot
Setting up the databases, Django serialises every model in every one of
them so that `TransactionTestCase(serialized_rollback=True)` can restore
them later. Nothing in this suite asks for that, so the work is pure cost.
On the ClickHouse alias it is worse than pure cost. Serialising builds a
`MigrationLoader`, and `django-clickhouse-backend` caches its migration
model on `MigrationRecorder` -- which carries a `deleted` column that
Django's does not. Get there with a PostgreSQL connection first and the
cache holds a model without that column, while the queryset still filters
on it, so the ClickHouse alias fails with
FieldError: Cannot resolve keyword 'deleted' into field
That only surfaces in the private build, where an app routed to ClickHouse
gives the alias something to serialise.1 parent adb635d commit d5c4d29
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
485 | 499 | | |
| 500 | + | |
486 | 501 | | |
487 | 502 | | |
488 | 503 | | |
489 | 504 | | |
| 505 | + | |
0 commit comments