Open jmchilton opened 5 years ago
So it seems we call app.shutdown
via atexit.register
as well as manually (when tearing down tests). If the hypothesis is correct that the simultaneous shutdown is at fault we could try using https://docs.python.org/3/library/atexit.html#atexit.unregister within the integration test base class, or wherever appropriate.
@mvdbeek and I were investigating unstable integration tests in dev. Too many postgres connections are used.
He enabled some extra logging here: https://github.com/galaxyproject/galaxy/pull/8439
We've noticed when they fail for this reason, they're the last tests. So we're not cleaning up something properly in integration tests. I think the extra logging sort of confirms this - you can see two app shutdowns per test case which is odd. App shuts down after the test completes and then all the apps seem to try to re-shutdown (without exception) after all the tests are complete.