scheduler: Increase timeout period when simulating (#63)

* 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 <kent@kry10.com>
Change-Id: I1fccce4c744581fbafb6aa064ea84a34aae7f1ec
diff --git a/apps/sel4test-tests/src/tests/scheduler.c b/apps/sel4test-tests/src/tests/scheduler.c
index b1c2404..b386779 100644
--- a/apps/sel4test-tests/src/tests/scheduler.c
+++ b/apps/sel4test-tests/src/tests/scheduler.c
@@ -49,7 +49,12 @@
     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;
 
@@ -59,9 +64,8 @@
     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);