diff --git a/docker/Dockerfile.psql b/docker/Dockerfile.psql new file mode 100644 index 0000000000..766d080465 --- /dev/null +++ b/docker/Dockerfile.psql @@ -0,0 +1,3 @@ +FROM postgres:12 as postgres + +CMD ["postgres", "-c", "log_transaction_sample_rate=1"] diff --git a/pyproject.toml b/pyproject.toml index 0f7a967861..adef363114 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -266,7 +266,7 @@ markers = [ "minio: mark test as requiring minio", "opensearch: mark test as requiring opensearch", ] -timeout = "600" +timeout = "60" timeout_method = "thread" [tool.tomlsort] diff --git a/tests/fixtures/database.py b/tests/fixtures/database.py index ec1362ac24..091adc9018 100644 --- a/tests/fixtures/database.py +++ b/tests/fixtures/database.py @@ -1000,8 +1000,11 @@ def database(application: ApplicationFixture) -> Iterable[DatabaseFixture]: @pytest.fixture(scope="function") def db( - database: DatabaseFixture, + database: DatabaseFixture, request ) -> Generator[DatabaseTransactionFixture, None, None]: + logging.getLogger("DatabaseFixture").info( + f"Running test: {request.node.name} at {utc_now()}" + ) tr = DatabaseTransactionFixture.create(database) yield tr tr.close() diff --git a/tox.ini b/tox.ini index 1721430ba6..1a9c66343e 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,8 @@ commands_pre = commands = api: pytest {posargs:tests/api} core: pytest {posargs:tests/core} +commands_post = + bash -c "docker ps | grep db-circ-tox | awk '{print $1}' | xargs docker logs" passenv = SIMPLIFIED_* CI @@ -28,6 +30,7 @@ allowlist_externals = python poetry pytest + bash [testenv:migration-docker] commands = @@ -45,7 +48,9 @@ allowlist_externals = coverage [docker:db-circ] -image = postgres:12 +dockerfile = {toxinidir}/docker/Dockerfile.psql +dockerfile_target = postgres +; image = postgres:12 environment = POSTGRES_USER=simplified_test POSTGRES_PASSWORD=test