#36652: Loading squashed migrations from disk raises CircularDependencyError
indeterministically
--------------------------------+------------------------------------
Reporter: Jayden Kneller | Owner: (none)
Type: Bug | Status: new
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: squashed | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------
Changes (by Jacob Walls):
* keywords: => squashed
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
* summary:
Django Squashed Migrations Randmonly Passing/Failing Based On Set
Iteration Order
=>
Loading squashed migrations from disk raises CircularDependencyError
indeterministically
Comment:
Thanks, the report makes sense, and I could reproduce with your sample
command. Appreciate the care you put into the report.
Yes, a test to demonstrate the issue is required, using the bare minimum
number of migrations. It should be possible to isolate the cycle and
recreate it with just two or three apps.
We will want a test for `LoaderTests`, and a small set of migrations in
`tests/migrations/test_migrations_squashed_...`. An example test for
migrations loading is `test_loading_squashed_complex_multi_apps`. Once you
have that, on the PR we can discuss ways to avoid patching the command to
shuffle. (At a glance, I think we can either mock `pkgutil.iter_modules`
to reverse the result, or if we want to avoid coupling our test to the
implementation, just create a second set of migration files that differ
only in naming, as long as this is not flaky.)
Would you like to push this over the line? If so, please set yourself in
the owner field. Thanks, and happy to help.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36652#comment:6>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.