tests/qtest: Fix npcm7xx_timer-test.c flaky test
authorChris Rauer <crauer@google.com>
Fri, 29 Sep 2023 00:08:31 +0000 (00:08 +0000)
committerThomas Huth <thuth@redhat.com>
Thu, 12 Oct 2023 12:11:44 +0000 (14:11 +0200)
npcm7xx_timer-test occasionally fails due to the state of the timers
from the previous test iteration.  Advancing the clock step after the
reset resolves this issue.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1897
Signed-off-by: Chris Rauer <crauer@google.com>
Message-ID: <20230929000831.691559-1-crauer@google.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/npcm7xx_timer-test.c

index 43711049ca747d509cc0ca53d065a0f81694294a..58f58c2f71b0bcfb9f6e33fd03fa69d6f4af3d5e 100644 (file)
@@ -465,6 +465,7 @@ static void test_periodic_interrupt(gconstpointer test_data)
     int i;
 
     tim_reset(td);
+    clock_step_next();
 
     tim_write_ticr(td, count);
     tim_write_tcsr(td, CEN | IE | MODE_PERIODIC | PRESCALE(ps));