From fe6f489ce629cce501cf5fecce74f3b96cbb8cd3 Mon Sep 17 00:00:00 2001 From: Curtis Millar Date: Wed, 12 May 2021 16:54:14 +1000 Subject: [PATCH] Ensure server prio greater than client for timeout We must ensure that during the reset of the server in the timeout test that the client is not able to preempt the server. If it does, it can perform a send before the server performs a receive. If this occurs, the server will not be blocked when the test thread removes its scheduling context and the test will hang indefinitely. Signed-off-by: Curtis Millar --- apps/sel4test-tests/src/tests/faults.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/sel4test-tests/src/tests/faults.c b/apps/sel4test-tests/src/tests/faults.c index 358f64d4..def8cb38 100644 --- a/apps/sel4test-tests/src/tests/faults.c +++ b/apps/sel4test-tests/src/tests/faults.c @@ -973,6 +973,11 @@ static int test_timeout_fault_in_server(env_t env) set_helper_sched_params(env, &client, 0.1 * US_IN_S, US_IN_S, client_data); start_helper(env, &client, (helper_fn_t) timeout_fault_client_fn, ep, 0, 0, 0); + /* Ensure the client doesn't preempt the server when the server is + * being reset */ + set_helper_priority(env, &server, OUR_PRIO - 1); + set_helper_priority(env, &client, OUR_PRIO - 2); + /* handle a few faults */ for (int i = 0; i < 5; i++) { ZF_LOGD("Handling fault");