tests: ztest: ztress: Relax timing requirements in the test

Seen failures on some platforms. No harm to relax the
check for test timeout.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-01-14 16:24:31 +01:00 committed by Anas Nashif
commit 19ea3a6416

View file

@ -29,8 +29,9 @@ static void test_timeout(void)
uint32_t repeat = 1000000;
k_timeout_t t = Z_TIMEOUT_TICKS(20);
int err;
int timeout = 1000;
ztress_set_timeout(K_MSEC(1000));
ztress_set_timeout(K_MSEC(timeout));
d = k_uptime_get();
@ -52,7 +53,7 @@ static void test_timeout(void)
d = k_uptime_get();
err = ztress_execute(&timer_data, thread_data, ARRAY_SIZE(thread_data));
d = k_uptime_get() - d;
zassert_within(d, 1000, 200, NULL);
zassert_within(d, timeout + 500, 500, NULL);
ztress_set_timeout(K_NO_WAIT);
}