Skip to content

Commit

Permalink
Use Now() in another test
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed Mar 31, 2024
1 parent f931351 commit 2971e30
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/transactron/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,6 @@ def test_latency_measurer(self):

event_queue = queue.Queue()

time = 0

def ticker():
nonlocal time

yield Passive()

while True:
yield
time += 1

finish = False

def producer():
Expand All @@ -273,6 +262,7 @@ def producer():

# Make sure that the time is updated first.
yield Settle()
time = (yield Now())
event_queue.put(time)
yield from self.random_wait_geom(0.8)

Expand All @@ -284,6 +274,7 @@ def consumer():

# Make sure that the time is updated first.
yield Settle()
time = (yield Now())
latencies.append(time - event_queue.get())

yield from self.random_wait_geom(1.0 / self.expected_consumer_wait)
Expand All @@ -303,7 +294,6 @@ def consumer():
with self.run_simulation(m) as sim:
sim.add_sync_process(producer)
sim.add_sync_process(consumer)
sim.add_sync_process(ticker)


@parameterized_class(
Expand Down

0 comments on commit 2971e30

Please sign in to comment.