Browse Source

pytest: Reduce the db_provider fixture scope to function

For performance reasons we were starting one for each session, which caused
the same postgres DB to be re-used for multiple tests (all test run in the
same worker process), but this could lead to interactions if there is a
timeout or a test happens to touch the `db_provider`. It turns out that we
were only saving about 15 seconds on a 1250 second run anyway, which is a
small cost for increased test isolation.
travis-experimental
Christian Decker 4 years ago
committed by Rusty Russell
parent
commit
5809cc41f4
  1. 2
      contrib/pyln-testing/pyln/testing/fixtures.py

2
contrib/pyln-testing/pyln/testing/fixtures.py

@ -316,7 +316,7 @@ providers = {
}
@pytest.fixture(scope="session")
@pytest.fixture
def db_provider(test_base_dir):
provider = providers[os.getenv('TEST_DB_PROVIDER', 'sqlite3')](test_base_dir)
provider.start()

Loading…
Cancel
Save