Commit bf0d77f5 authored by Federico Vaga's avatar Federico Vaga

tst: more test_output_period withing decent time limits

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent e66d5c79
......@@ -164,7 +164,12 @@ class TestFmcfdLoop(object):
assert ts[0].coarse - start.coarse <= 3 # there is < 3ns cable
@pytest.mark.parametrize("period_ps", [random.randrange(400000, 1000000000000)])
@pytest.mark.parametrize("period_ps", [random.randrange(1000000, 10000000) for x in range(128)] +
[random.randrange(10000000, 100000000) for x in range(64)] +
[random.randrange(100000000, 1000000000) for x in range(32)] +
[random.randrange(1000000000, 10000000000) for x in range(16)] +
[random.randrange(10000000000, 100000000000) for x in range(8)] +
[random.randrange(100000000000, 1000000000000) for x in range(4)])
@pytest.mark.parametrize("count", [10])
def test_output_period(self, fmcfd_chan, fmcfd_tdc, period_ps, count):
"""
......@@ -174,10 +179,10 @@ class TestFmcfdLoop(object):
"""
ts = []
start = fmcfd_chan.dev.time + FmcFineDelayTime(2, 0, 0, 0, 0)
start = fmcfd_chan.dev.time + FmcFineDelayTime(0, 500000, 0, 0, 0)
fmcfd_chan.pulse_generate(start, int(period_ps / 2), period_ps, count)
time.sleep(2 + (count * period_ps) / 1000000000000.0)
assert len(fmcfd_tdc.poll(10000)) > 0
time.sleep(0.02 + (count * period_ps) / 1000000000000.0)
assert len(fmcfd_tdc.poll(100)) > 0
ts = fmcfd_tdc.read(count, os.O_NONBLOCK)
assert len(ts) == count
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment