Skip to content

Commit

Permalink
scheduler: Increase timeout period when simulating (#63)
Browse files Browse the repository at this point in the history
* scheduler: Increase timeout period when simulating

Waiting for two timeouts is not enough when simulating in cloud
instances. Increase the timeout period under simulation to 100ms.

Signed-off-by: Kent McLeod <[email protected]>
  • Loading branch information
kent-mcleod authored Dec 9, 2021
1 parent fae7635 commit 62d8d06
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/sel4test-tests/src/tests/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ static int test_thread_suspend(env_t env)
set_helper_priority(env, &t1, 100);
start_helper(env, &t1, (helper_fn_t) counter_func, (seL4_Word) &counter, 0, 0, 0);

sel4test_periodic_start(env, 10 * NS_IN_MS);
/* We increase the timeout in cases where we are running on a simulator that
* simulates larger clock rates via compressing the clock stream and can
* cause large instantaneous time jumps.
*/
int timeout = config_set(CONFIG_SIMULATION) ? 100 : 10;
sel4test_periodic_start(env, timeout * NS_IN_MS);

seL4_Word old_counter;

Expand All @@ -59,9 +64,8 @@ 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.
/* We wait for two timer interrupts to force a block in case 100ms passes
* instantly in cases where we are running on a simulator.
*/
sel4test_ntfn_timer_wait(env);
sel4test_ntfn_timer_wait(env);
Expand Down

0 comments on commit 62d8d06

Please sign in to comment.