Skip to content

Commit 433a85e

Browse files
evgeniy-paltsevcfriedt
authored andcommitted
test: posix: skip nanosleep testcase for ARC HSDK boards
The comparison of cycles we get with k_cycle_get_32 may be incorrect if counter wrap happened. In case of ARC HSDK and ARC HSDK4xD platforms we have high counter clock frequency (500MHz or 1GHz) so counter wrap quite likely to happen if we wait long enough. As in some test cases we wait more than 1 second, there are significant chances to get false-positive assertion. So let's skip nanosleep testcase for ARC HSDK and ARC HSDK4xD boards. The proper fix is to use k_cycle_get_64 in this test case, but we need to provide k_cycle_get_64 support for ARC HSDK and ARC HSDK4xD platforms first. Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent e9a8497 commit 433a85e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/posix/common/src/nanosleep.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,16 @@ static void common_lower_bound_check(int selection, clockid_t clock_id, int flag
186186
/* round up to the nearest microsecond for k_busy_wait() */
187187
exp_ns = DIV_ROUND_UP(exp_ns, NSEC_PER_USEC) * NSEC_PER_USEC;
188188

189+
/* The comparison may be incorrect if counter wrap happened. In case of ARC HSDK platforms
190+
* we have high counter clock frequency (500MHz or 1GHz) so counter wrap quite likely to
191+
* happen if we wait long enough. As in some test cases we wait more than 1 second, there
192+
* are significant chances to get false-positive assertion.
193+
* TODO: switch test for k_cycle_get_64 usage where available.
194+
*/
195+
#if !defined(CONFIG_SOC_ARC_HSDK) && !defined(CONFIG_SOC_ARC_HSDK4XD)
189196
/* lower bounds check */
190197
zassert_true(actual_ns >= exp_ns, "actual: %llu expected: %llu", actual_ns, exp_ns);
198+
#endif
191199

192200
/* TODO: Upper bounds check when hr timers are available */
193201
}

0 commit comments

Comments
 (0)