Skip to content

Commit 7aa3f90

Browse files
authored
Merge pull request #237 from proxystore/parsl-shutdown-tests
Shutdown parsl executors in tests
2 parents 5645ab0 + cd9b77e commit 7aa3f90

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tests/executor/parsl_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def mock_monitoring() -> Generator[mock.MagicMock, None, None]:
4646
def test_get_local_executor(tmp_path: pathlib.Path) -> None:
4747
run_dir = str(tmp_path / 'parsl')
4848
config = ParslLocalConfig(run_dir=run_dir)
49-
executor = config.get_executor()
50-
assert isinstance(executor, Executor)
49+
with config.get_executor() as executor:
50+
assert isinstance(executor, Executor)
5151

5252

5353
def test_get_htex_executor(tmp_path: pathlib.Path, mock_monitoring) -> None:
@@ -197,9 +197,12 @@ def test_htex_config() -> None:
197197
worker_port_range=[0, 0],
198198
interchange_port_range=[0, 0],
199199
)
200-
assert isinstance(config.get_executor(), HighThroughputExecutor)
200+
201+
with config.get_executor() as executor:
202+
assert isinstance(executor, HighThroughputExecutor)
201203

202204

203205
def test_htex_config_default() -> None:
204206
config = HTExConfig()
205-
assert isinstance(config.get_executor(), HighThroughputExecutor)
207+
with config.get_executor() as executor:
208+
assert isinstance(executor, HighThroughputExecutor)

tests/run/config_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,5 @@ def test_read_parsl_htex_config(tmp_path: pathlib.Path) -> None:
144144
config.engine.executor.htex, # type: ignore[attr-defined]
145145
'get_executor',
146146
):
147-
config.engine.executor.get_executor()
147+
with config.engine.executor.get_executor():
148+
pass

0 commit comments

Comments
 (0)