From 2971e307ae2764e7530d16dd4a0a4cca4bb04579 Mon Sep 17 00:00:00 2001 From: Marek Materzok Date: Sun, 31 Mar 2024 16:24:43 +0200 Subject: [PATCH] Use Now() in another test --- test/transactron/test_metrics.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/transactron/test_metrics.py b/test/transactron/test_metrics.py index c197c5605..16d1cdf1e 100644 --- a/test/transactron/test_metrics.py +++ b/test/transactron/test_metrics.py @@ -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(): @@ -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) @@ -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) @@ -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(