Skip to content

Commit a4fa77e

Browse files
committed
fixing unit test as well
1 parent cd4f08f commit a4fa77e

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tests/unit_tests/test_time_series.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from packaging import version
2+
from time import sleep
23

34
import numpy as np
45
import pynwb
@@ -189,15 +190,23 @@ def test_check_none_matnwb_resolution_pass():
189190
190191
produced with MatNWB, when read with PyNWB~=2.0.1 and HDMF<=3.2.1 contains a resolution value of None.
191192
"""
192-
with pynwb.NWBHDF5IO(
193-
path="https://dandiarchive.s3.amazonaws.com/blobs/da5/107/da510761-653e-4b81-a330-9cdae4838180",
194-
mode="r",
195-
load_namespaces=True,
196-
driver="ros3",
197-
) as io:
198-
nwbfile = io.read()
199-
time_series = nwbfile.processing["video_files"]["video"].time_series["20170203_KIB_01_s1.1.h264"]
200-
assert check_resolution(time_series) is None
193+
max_retries = 10
194+
retries = 0
195+
196+
while retries < max_retries:
197+
try:
198+
retries += 1
199+
with pynwb.NWBHDF5IO(
200+
path="https://dandiarchive.s3.amazonaws.com/blobs/da5/107/da510761-653e-4b81-a330-9cdae4838180",
201+
mode="r",
202+
load_namespaces=True,
203+
driver="ros3",
204+
) as io:
205+
nwbfile = io.read()
206+
time_series = nwbfile.processing["video_files"]["video"].time_series["20170203_KIB_01_s1.1.h264"]
207+
except OSError: # Cannot curl request
208+
sleep(0.1 * 2**retries)
209+
assert check_resolution(time_series) is None
201210

202211

203212
def test_check_resolution_fail():

0 commit comments

Comments
 (0)