Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issues with SCHED0000 test #62

Merged
merged 2 commits into from
Dec 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/sel4test-tests/src/tests/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ static int test_thread_suspend(env_t env)
old_counter = counter;

/* Let it run again. */
/* We wait for two timer interrupts to force a block in case 10ms passes instantly
* in cases where we are running on a simulator that simulates larger clock rates
* via compressing the clock stream.
*/
sel4test_ntfn_timer_wait(env);
sel4test_ntfn_timer_wait(env);

/* Now, counter should have moved. */
Expand All @@ -68,13 +73,15 @@ static int test_thread_suspend(env_t env)
/* Suspend the thread, and wait again. */
seL4_TCB_Suspend(get_helper_tcb(&t1));
sel4test_ntfn_timer_wait(env);
sel4test_ntfn_timer_wait(env);

/* Counter should not have moved. */
test_check(counter == old_counter);
old_counter = counter;

/* Check once more for good measure. */
sel4test_ntfn_timer_wait(env);
sel4test_ntfn_timer_wait(env);

/* Counter should not have moved. */
test_check(counter == old_counter);
Expand All @@ -91,8 +98,7 @@ static int test_thread_suspend(env_t env)
return sel4test_get_result();
}
DEFINE_TEST(SCHED0000, "Test suspending and resuming a thread (flaky)", test_thread_suspend,
config_set(CONFIG_HAVE_TIMER)
&& !config_set(CONFIG_ARCH_RISCV))
config_set(CONFIG_HAVE_TIMER))

/*
* Test TCB Resume on self.
Expand Down