Opened 9 years ago
Last modified 9 years ago
#25647 closed Bug
Regression with TEST MIRROR database migrations — at Version 2
Reported by: | Gavin Wahl | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.9b1 |
Severity: | Release blocker | Keywords: | |
Cc: | Aymeric Augustin | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I have a project with two databases: 'default' and 'logging', where logging is just an alias for default (to allow writing to logging while in a transaction in default). I have logging has 'TEST': {'MIRROR': 'default'}
, and a database router that doesn't allow migrating on logging.
When running the tests, migrations randomly fail to run. This is because get_unique_databases
stores all the aliases for a specific database in a set, and then setup_databases
migrates on the 'first' one, despite sets not having a 'first' element. This randomly, based on hash randomization in python, picks either 'default' or 'logging' to be migrated. When 'logging' is migrated, all the migrations are no-ops because migrating is turned off for 'logging'.
I believe this is a regression introduced in [49eee8424].
Change History (2)
comment:1 by , 9 years ago
Version: | 1.8 → 1.9b1 |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|