RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

tests-zt: This test stalls compiled with tests-pkg and tests-nanocoap_cache

Open kfessel opened this issue 3 years ago • 7 comments

@miri64 found an issue with unittest and ztimer_sleep in

https://github.com/RIOT-OS/RIOT/pull/17680#issuecomment-1184312760

Contribution description

this PR has a test to reproduce this issue

Testing procedure

make tests-zt tests-nanocoap_cache tests-pkt
make term

or

USEMODULE="ztimer_sec" make tests-zt tests-pkt

will show the issue

make tests-zt 
make term

will not

Issues/PRs references

https://github.com/RIOT-OS/RIOT/pull/17680#issuecomment-1184312760

kfessel avatar Jul 15 '22 11:07 kfessel

i ran module info

m1.txt failing m2.txt working

make tests-zt tests-pkt info-modules > m3 m3.txt working USEMODULE="ztimer_sec" make tests-zt tests-pkt info-modules > m4 m4.txt failing

kfessel avatar Jul 15 '22 11:07 kfessel

USEMODULE="ztimer_sec" make tests-zt tests-pkt

also has the issue

kfessel avatar Jul 15 '22 11:07 kfessel

USEMODULE="ztimer_sec evtimer" make tests-zt term make the issue appear

kfessel avatar Jul 15 '22 12:07 kfessel

USEMODULE="ztimer_sec evtimer" make tests-zt term make the issue appear

So maybe just removing the gnrc_ipv6 dependency from tests-pkt might be enough? Looking at the tests, this should really be gnrc_nettype_ipv6 (which was introduced later than the test was deployed).

miri64 avatar Jul 15 '22 13:07 miri64

I think this is caused by unittests/main.c calling xtimer_init(), which in the (default) ztimer_xtimer_compat case leads to ztimer_init() being called twice. That`s not supposed to happen.

kaspar030 avatar Jul 15 '22 20:07 kaspar030

I think this is caused by unittests/main.c calling xtimer_init(), which in the (default) ztimer_xtimer_compat case leads to ztimer_init() being called twice. That`s not supposed to happen.

Mh... xtimer_init() used to be idempotent :-/ Could this be assured (or at least a full state reset) for ztimer_init as well?

miri64 avatar Jul 15 '22 21:07 miri64

not calling xtimer_init when when using compat mode seems to solve

https://github.com/RIOT-OS/RIOT/blob/897abd09f2539f4e36e34e78402d7dcfad09e5b6/sys/include/ztimer/xtimer_compat.h#L70-L73

Should we remove L72? (sys/auto_init has the same do not call xtimer_init if compat mode)

kfessel avatar Jul 18 '22 12:07 kfessel