Commit e7c0cb17 authored by Federico Vaga's avatar Federico Vaga

tst: fix timeout computation

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent a5547c2a
......@@ -36,7 +36,7 @@ def fmcfd_tdc(request, fmcfd):
def timeout_compute(start, period_ps, count):
proportional = ((count * period_ps)/1000000000000.0)
return time.time() + proportional + start.seconds + 10
return time.time() + proportional + start + 5
class TestFmcfdLoop(object):
"""
......@@ -73,10 +73,10 @@ class TestFmcfdLoop(object):
channel.
"""
ts = []
start = fmcfd.time + FmcFineDelayTime(2, 0, 0)
start_s = 2
start = fmcfd.time + FmcFineDelayTime(start_s, 0, 0)
fmcfd_chan.pulse_generate(start, width, period, count)
timeout = timeout_compute(start, period, count)
timeout = timeout_compute(start_s, period, count)
while len(ts) < count and time.time() < timeout:
if len(fmcfd_tdc.poll()) == 0:
continue
......@@ -97,12 +97,12 @@ class TestFmcfdLoop(object):
"""
pending = count
ts = []
start = FmcFineDelayTime(2, 0, 0)
start_s = 2
start = FmcFineDelayTime(start_s, 0, 0)
fmcfd_chan.pulse_generate(fmcfd_chan.dev.time + start,
width, period, count)
timeout = timeout_compute(start, period, count)
timeout = timeout_compute(start_s, period, count)
while pending > 0 and time.time() < timeout:
if len(fmcfd_tdc.poll()) == 0:
continue
......
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