[native_sim] k_msleep is incoherent with ztest #88774
-
Using Zephyr version: v4.1.0-rc3-13-g1b1973799308 When running tests on native_sim/native/64, calling k_sleep, k_msleep or related functions does NOT work as expected. Below you can see running a basic test, which should sleep for 10 seconds, took only 5.69 seconds to complete. INFO - Total complete: 1/ 1 100% built (not run): 0, filtered: 1, failed: 0, error: 0
INFO - 2 test scenarios (2 configurations) selected, 1 configurations filtered (1 by static filter, 0 at runtime).
INFO - 1 of 1 executed test configurations passed (100.00%), 0 built (not run), 0 failed, 0 errored, with no warnings in 5.69 seconds.
INFO - 1 of 1 executed test cases passed (100.00%) on 1 out of total 948 platforms (0.11%).
INFO - 1 test configurations executed on platforms, 0 test configurations were only built. But in the handler logs you can see it thinks 10 seconds elapsed ... ------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [dtls]: pass = 1, fail = 0, skip = 0, total = 1 duration = 10.001 seconds
- PASS - [dtls.test_secure_coap] duration = 10.001 seconds
------ TESTSUITE SUMMARY END ------ I have reduced the kconfig options to CONFIG_ZTEST=y
CONFIG_PRINTK=y and the code to #include <zephyr/ztest.h>
ZTEST(sleep, test_sleep)
{
printk("%lld %lld\n", k_uptime_get(), k_uptime_ticks());
printk("%d\n", k_msleep(10 * 1000));
printk("%lld %lld\n", k_uptime_get(), k_uptime_ticks());
}
ZTEST_SUITE(sleep, NULL, NULL, NULL, NULL, NULL); What can cause this? At this point I am trying to look into the systick code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Managed to found CONFIG_NATIVE_SIM_SLOWDOWN_TO_REAL_TIME... |
Beta Was this translation helpful? Give feedback.
Managed to found CONFIG_NATIVE_SIM_SLOWDOWN_TO_REAL_TIME...