Skip to content

Commit 1e0a96e

Browse files
[MRG] fixing the test write parallel (#1473)
1 parent 60830be commit 1e0a96e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mne_bids/tests/test_write.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import os.path as op
1313
import shutil as sh
1414
import sys
15+
import time
1516
import warnings
1617
from concurrent.futures import ProcessPoolExecutor
1718
from datetime import date, datetime, timedelta, timezone
@@ -4249,6 +4250,7 @@ def test_write_bids_with_age_weight_info(tmp_path, monkeypatch):
42494250
write_raw_bids(raw, bids_path=bids_path)
42504251

42514252

4253+
@pytest.mark.flaky(reruns=3, reruns_delay=5)
42524254
@pytest.mark.filterwarnings(
42534255
"ignore:No events found or provided:RuntimeWarning",
42544256
"ignore:Found no extension for raw file.*:RuntimeWarning",
@@ -4287,5 +4289,7 @@ def test_parallel_write_many_subjects(tmp_path):
42874289
# In case lock is still held or file is in use, that's OK
42884290
pass
42894291

4292+
# putting some sleep to make sure all file locks are released
4293+
time.sleep(1)
42904294
# No stale lock files should remain after the parallel writes complete.
42914295
assert not any(bids_root.rglob("*.lock"))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ full = [
7474
"pymatreader",
7575
]
7676
# Dependencies for running the test infrastructure
77-
test = ["mne_bids[full]", "pytest", "pytest-cov", "pytest-sugar", "ruff"]
77+
test = ["mne_bids[full]", "pytest", "pytest-cov", "pytest-rerunfailures", "pytest-sugar", "ruff"]
7878

7979
[project.urls]
8080
"Bug Tracker" = "https://github.com/mne-tools/mne-bids/issues/"

0 commit comments

Comments
 (0)