Skip to content

Commit b9d57fc

Browse files
committed
log fd counts
1 parent 3a256de commit b9d57fc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

parsl/tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from itertools import chain
2121

2222
import _pytest.runner as runner
23+
import psutil
2324
import pytest
2425

2526
import parsl
@@ -179,6 +180,9 @@ def load_dfk_session(request, pytestconfig, tmpd_cwd_session):
179180
config = pytestconfig.getoption('config')[0]
180181

181182
if config != 'local':
183+
this_process = psutil.Process()
184+
start_fds = this_process.num_fds()
185+
logger.error(f"BENC: start open fds: {start_fds}")
182186
spec = importlib.util.spec_from_file_location('', config)
183187
module = importlib.util.module_from_spec(spec)
184188
spec.loader.exec_module(module)
@@ -206,6 +210,8 @@ def load_dfk_session(request, pytestconfig, tmpd_cwd_session):
206210
raise RuntimeError("DFK changed unexpectedly during test")
207211
dfk.cleanup()
208212
assert DataFlowKernelLoader._dfk is None
213+
end_fds = this_process.num_fds()
214+
logger.error(f"BENC: end open fds: {end_fds}")
209215
else:
210216
yield
211217

@@ -227,6 +233,10 @@ def load_dfk_local_module(request, pytestconfig, tmpd_cwd_session):
227233
config = pytestconfig.getoption('config')[0]
228234

229235
if config == 'local':
236+
this_process = psutil.Process()
237+
start_fds = this_process.num_fds()
238+
logger.error(f"BENC: start open fds: {start_fds}")
239+
230240
local_setup = getattr(request.module, "local_setup", None)
231241
local_teardown = getattr(request.module, "local_teardown", None)
232242
local_config = getattr(request.module, "local_config", None)
@@ -258,6 +268,8 @@ def load_dfk_local_module(request, pytestconfig, tmpd_cwd_session):
258268
raise RuntimeError("DFK changed unexpectedly during test")
259269
dfk.cleanup()
260270
assert DataFlowKernelLoader._dfk is None
271+
end_fds = this_process.num_fds()
272+
logger.error(f"BENC: end open fds: {end_fds} (vs start {start_fds}")
261273

262274
else:
263275
yield

0 commit comments

Comments
 (0)