Skip to content

Commit 91e8a17

Browse files
Nicolas Pitrefabiobaltieri
authored andcommitted
tests/semaphore: fix "cpu test took too long" assertion failure
The SMP config for RISC-V on QEMU triggers this: |START - test_sem_queue_mutual_exclusion | |Assertion failed at | WEST_TOPDIR/zephyr/subsys/testsuite/ztest/src/ztest_new.c:155: | cpu_hold: (dt < 3000 is false) |1cpu test took too long (4090 ms) |ERROR: cannot fail in test 'after()', bailing Looping 10000 times is maybe a bit excessive. Signed-off-by: Nicolas Pitre <[email protected]>
1 parent 1f362a8 commit 91e8a17

File tree

1 file changed

+2
-2
lines changed
  • tests/kernel/semaphore/semaphore/src

1 file changed

+2
-2
lines changed

tests/kernel/semaphore/semaphore/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void sem_take_multiple_high_prio_helper(void *p1, void *p2, void *p3)
175175
/* First function for mutual exclusion test */
176176
void sem_queue_mutual_exclusion1(void *p1, void *p2, void *p3)
177177
{
178-
for (int i = 0; i < 10000; i++) {
178+
for (int i = 0; i < 1000; i++) {
179179
expect_k_sem_take_nomsg(&mut_sem, K_FOREVER, 0);
180180

181181
/* in that function critical section makes critical var +1 */
@@ -194,7 +194,7 @@ void sem_queue_mutual_exclusion1(void *p1, void *p2, void *p3)
194194
/* Second function for mutual exclusion test */
195195
void sem_queue_mutual_exclusion2(void *p1, void *p2, void *p3)
196196
{
197-
for (int i = 0; i < 10000; i++) {
197+
for (int i = 0; i < 1000; i++) {
198198
expect_k_sem_take_nomsg(&mut_sem, K_FOREVER, 0);
199199

200200
/* in that function critical section makes critical var 0 */

0 commit comments

Comments
 (0)