Skip to content

Commit 43bbb45

Browse files
increase timeouts for test_start_stop_scheduler_task to account for possible thread descheduling (#1080)
1 parent f26f368 commit 43bbb45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/z_api_scheduler_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,19 @@ static void test_start_stop_scheduler_task(void) {
148148
_zp_closure_periodic_task_t cl = mk_closure(&ctx);
149149
uint32_t id = 0;
150150

151-
// Add a 50 ms job
152-
ASSERT_OK(_zp_periodic_task_add(inner, &cl, 50, &id));
151+
// Add a 500 ms job
152+
ASSERT_OK(_zp_periodic_task_add(inner, &cl, 500, &id));
153153
ASSERT_TRUE(id != 0);
154154

155155
// Allow a few periods to elapse
156-
z_sleep_ms(170);
156+
z_sleep_ms(1700);
157157
int hits_after_start = ctx.hits;
158158
ASSERT_TRUE(hits_after_start >= 2); // typically 3–4, but allow margin
159159

160160
// Stop the scheduler: hits must stop increasing
161161
ASSERT_OK(zp_stop_periodic_scheduler_task(z_loan_mut(s)));
162162
int stop_snapshot = ctx.hits;
163-
z_sleep_ms(150);
163+
z_sleep_ms(1500);
164164
ASSERT_TRUE(ctx.hits == stop_snapshot);
165165

166166
// Remove task; should call drop exactly once

0 commit comments

Comments
 (0)