npcm7xx_timer-test failing sporadically in CI
Hi,
The npcm7xx_timer test fails sometimes in QEMU's CI. Is it possible that "clock_step" is stepping to some other deadline and not the npcm7xx_timer device's deadline?
In tests/qtest/npcm7xx_timer-test.c:
/* Verifies that a periodict timer fires an interrupt every time it expires. */
static void test_periodic_interrupt(gconstpointer test_data)
{
const TestData *td = test_data;
unsigned int count = 65535;
unsigned int ps = 2;
int i; tim_reset(td);
tim_write_ticr(td, count);
tim_write_tcsr(td, CEN | IE | MODE_PERIODIC | PRESCALE(ps));
for (i = 0; i < 4; i++) {
clock_step_next();
^^^^^^^^^^^^^^^^^
g_assert_cmphex(tim_read(td, TISR), ==, tim_timer_bit(td));
g_assert_true(qtest_get_irq(global_qtest, tim_timer_irq(td)));Here is the output from a test failure:
56/113 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test ERROR 0.82s exit status 1
Quoted 1 line
Quoted 1 line
Quoted 1 line
MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 QTEST_QEMU_IMG=./qemu-img MESON_TEST_ITERATION=1 QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 QTEST_QEMU_BINARY=./qemu-system-arm G_TEST_DBUS_DAEMON=/builds/qemu-project/qemu/tests/dbus-daemon.sh RUST_BACKTRACE=1 PYTHON=/builds/qemu-project/qemu/build/pyvenv/bin/python3 MALLOC_PERTURB_=187 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /builds/qemu-project/qemu/build/tests/qtest/npcm7xx_timer-test --tap -k
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
**
ERROR:../tests/qtest/npcm7xx_timer-test.c:475:test_periodic_interrupt: assertion failed (tim_read(td, TISR) == tim_timer_bit(td)): (0x00000000 == 0x00000010) **
ERROR:../tests/qtest/npcm7xx_timer-test.c:475:test_periodic_interrupt: code should not be reached
**
ERROR:../tests/qtest/npcm7xx_timer-test.c:476:test_periodic_interrupt: 'qtest_get_irq(global_qtest, tim_timer_irq(td))' should be TRUE (test program exited with status code 1)
https://gitlab.com/qemu-project/qemu/-/jobs/14108292900#L5637
Stefan