Skip to content

Commit

Permalink
tests/qtest: Fix npcm7xx_timer-test.c flaky test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chrisrauer authored and huth committed Oct 12, 2023
1 parent e9a5426 commit d0353b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/qtest/npcm7xx_timer-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d0353b6

Please sign in to comment.