glamorous-planet-14786
12/10/2023, 5:47 PMpants
, pytest
, docker
and alembic
The top level symptom is that different tests seem to somehow "find" the nominally isolated database testing containers of other tests, which leads to a strange variety of errors. Most tests follow a recipe where they (by means of pytest fixtures)
1. Spin up a testcontainers
database instance
2. Migrate the nude database up to the current state (alembic)
3. Run a test
4. Migrate the database back down
5. Close out the container
What is confusing is that we occasionally in CI will set a large subset of tests will fail the the artifact that it will report non-existant tables, with what looks like a mismatched down-migration. It feels like tests within a batch are polluting each other somehow.
Is there a way to determine which tests are batched together for a particular run?glamorous-planet-14786
12/10/2023, 5:49 PMhappy-kitchen-89482
12/11/2023, 12:38 AMhappy-kitchen-89482
12/11/2023, 12:38 AMhappy-kitchen-89482
12/11/2023, 12:40 AMglamorous-planet-14786
12/11/2023, 4:18 PMhappy-kitchen-89482
12/11/2023, 4:33 PMhappy-kitchen-89482
12/11/2023, 4:34 PMhappy-kitchen-89482
12/11/2023, 4:34 PM--keep-sandboxes=always
to preserve those sandboxes and then you can play around inside them directly, without Pants in the mix, to see what's going on