Skip to content

Commit 72f1558

Browse files
authored
fix: Teardown trino container correctly after tests (#2562)
Signed-off-by: Achal Shah <[email protected]>
1 parent 53c2ce2 commit 72f1558

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ install-go-ci-dependencies:
147147
go install github.com/go-python/gopy
148148

149149
install-protoc-dependencies:
150-
pip install grpcio-tools==1.34.0
150+
pip install grpcio-tools==1.44.0
151151

152152
compile-protos-go: install-go-proto-dependencies install-protoc-dependencies
153153
cd sdk/python && python setup.py build_go_protos

sdk/python/tests/conftest.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,24 @@ def teardown(cls):
195195
cls.container.stop()
196196

197197

198+
@pytest.fixture(scope="session")
199+
def trino_fixture(request):
200+
def teardown():
201+
TrinoContainerSingleton.teardown()
202+
203+
request.addfinalizer(teardown)
204+
return TrinoContainerSingleton
205+
206+
198207
@pytest.fixture(
199208
params=FULL_REPO_CONFIGS, scope="session", ids=[str(c) for c in FULL_REPO_CONFIGS]
200209
)
201-
def environment(request, worker_id: str):
210+
def environment(request, worker_id: str, trino_fixture):
202211
if "TrinoSourceCreator" in request.param.offline_store_creator.__name__:
203212
e = construct_test_environment(
204213
request.param,
205214
worker_id=worker_id,
206-
offline_container=TrinoContainerSingleton.get_singleton(),
215+
offline_container=trino_fixture.get_singleton(),
207216
)
208217
else:
209218
e = construct_test_environment(request.param, worker_id=worker_id)

0 commit comments

Comments
 (0)