Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25647 closed Bug (fixed)

Regression with TEST MIRROR database migrations

Reported by: Gavin Wahl Owned by: Tim Graham
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 Tim Graham)

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 (8)

comment:1 by Gavin Wahl, 9 years ago

Version: 1.81.9b1

comment:2 by Tim Graham, 9 years ago

Description: modified (diff)

comment:3 by Tim Graham, 9 years ago

Cc: Aymeric Augustin added

Aymeric, could you provide input on this one?

comment:4 by Aymeric Augustin, 9 years ago

Well, aside from "sorry I must have messed up" and "I wish we could test this", I don't have much to say :-(

IIRC this commit was in the middle of a refactoring and cannot be easily reverted. I'll try to write a patch but I'm not sure when I'll find time for that.

comment:5 by Tim Graham, 9 years ago

Owner: changed from nobody to Tim Graham
Severity: NormalRelease blocker
Status: newassigned
Triage Stage: UnreviewedAccepted

I'm looking into the issue in hopes of solving it before Monday's release candidate.

comment:6 by Tim Graham, 9 years ago

Has patch: set

I don't know if we should try to consult database routers in this code at some point, but for now I took the conservative solution of reverting the original patch. It was a pretty clean revert. The original commit is part of this pull request. As far as I could tell, it's not actually important for Oracle support (at least for now, since we don't support parallel testing on Oracle).

PR

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In ce737ac6:

Fixed #25647 -- Reverted "Simplified deduplication of test databases."

This reverts commit 49eee84245b1297a84ad4ddc2251e287ef585ea2 as it caused
a regression with test mirrors.

comment:8 by Tim Graham <timograham@…>, 9 years ago

In 8a03102f:

[1.9.x] Fixed #25647 -- Reverted "Simplified deduplication of test databases."

This reverts commit 49eee84245b1297a84ad4ddc2251e287ef585ea2 as it caused
a regression with test mirrors.

Backport of ce737ac67845da9a73ad645d6b9fb1692390ad56 from master

Note: See TracTickets for help on using tickets.
Back to Top