Skip to content

Commit d86e3f2

Browse files
authored
Merge pull request datalad#4234 from mih/tst-openfiles
TST: Relax get_open_files() test on Windows due to performance issues.
2 parents 55947c1 + e43c133 commit d86e3f2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

datalad/tests/test_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,16 @@ def test_get_open_files(p):
11901190
os.getpid())
11911191

11921192
assert not get_open_files(subd)
1193+
1194+
if on_windows:
1195+
# the remainder of the test assume a certain performance.
1196+
# however, on windows get_open_files() can be very slow
1197+
# (e.g. the first invocation in this test (above) can easily
1198+
# take 30-50s). It is not worth slowing the tests to
1199+
# accomodate this issue, given we have tested proper functioning
1200+
# in principle already above).
1201+
return
1202+
11931203
# if we start a process within that directory, should get informed
11941204
from subprocess import Popen, PIPE
11951205
from time import time

datalad/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ def rmdir(path, *args, **kwargs):
446446
def get_open_files(path, log_open=False):
447447
"""Get open files under a path
448448
449+
Note: This function is very slow on Windows.
450+
449451
Parameters
450452
----------
451453
path : str

0 commit comments

Comments
 (0)