From 77b6264da12100cc1e04e88691f7d71d97888b23 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 8 Nov 2024 20:52:14 +0100 Subject: [PATCH] tests/net/gnrc_sixlowpan_frag_sfr_congure: work around bug in test The test following test is flaky: TEST_ASSERT(msg->send_time > 0U); It assumes that 0 as time is indicating the time is invalid. But on `native`, the time will be zero for the first millisecond the test is launched. Before the interactive sync caused seemingly a reliable delay of at least one milli second, but this no longer is the case. This works around the bug by just waiting at the start of the test until the time is no longer zero, possibly spinning for one millisecond. --- tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c b/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c index a3cd545d43..92433293a3 100644 --- a/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c +++ b/tests/net/gnrc_sixlowpan_frag_sfr_congure/main.c @@ -802,6 +802,10 @@ int main(void) { _tests_init(); + /* work around issue in _check_congure_snd_msg(): the assert for + * time > o will not work when the time is 0 */ + while (xtimer_now_usec() / US_PER_MS == 0) { } + TESTS_START(); TESTS_RUN(tests_gnrc_sixlowpan_frag_sfr_congure_integration()); TESTS_END();