From 841eaeb84a96cb1b20172b1ab293ebef0bb573a5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 11 Jan 2022 13:53:07 +0100 Subject: fix(simulator): Flush results before accessing counters This change updates the simulator implementation to flush the active progress when accessing the hypervisor counters. Previously, if the counters were accessed, while the mux or consumer was in progress, its counter values were not accurate. --- .../src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc-compute/opendc-compute-simulator/src/test') diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt index dd13b60c..f0325023 100644 --- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt +++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt @@ -173,7 +173,7 @@ internal class SimHostTest { assertAll( { assertEquals(658, activeTime, "Active time does not match") }, - { assertEquals(1741, idleTime, "Idle time does not match") }, + { assertEquals(2341, idleTime, "Idle time does not match") }, { assertEquals(637, stealTime, "Steal time does not match") }, { assertEquals(1500001, clock.millis()) } ) @@ -278,7 +278,7 @@ internal class SimHostTest { meterProvider.close() assertAll( - { assertEquals(1175, idleTime, "Idle time does not match") }, + { assertEquals(1775, idleTime, "Idle time does not match") }, { assertEquals(624, activeTime, "Active time does not match") }, { assertEquals(900001, uptime, "Uptime does not match") }, { assertEquals(300000, downtime, "Downtime does not match") }, -- cgit v1.2.3