From 822325ca287b3d0ba27be820d436806612b64a71 Mon Sep 17 00:00:00 2001 From: Richael Zhuang Date: Thu, 16 Feb 2023 16:08:53 +0800 Subject: [PATCH] test/schedule: fix idle.sh test failure idle.sh sometimes fails because the app_thread's idle time is less than busy time. For rpc "framework_set_scheduler dynamic" will initialize the dpdk_governor which finally call rte_power_init. This process is time consuming on some systems which may make app_thread busy. We can allow the app_thread to be busy for the first sample. This is one solution. It also works if we call sleep for some time after calling rpc framework_set_scheduler. Change-Id: Ia2f4b2f35e94657ce093ce261438ab710399435a Signed-off-by: Richael Zhuang Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16825 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Michal Berger Reviewed-by: Tomasz Zawadzki --- test/scheduler/idle.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/scheduler/idle.sh b/test/scheduler/idle.sh index a0c1172b4..fff3aec37 100755 --- a/test/scheduler/idle.sh +++ b/test/scheduler/idle.sh @@ -14,7 +14,7 @@ trap 'killprocess "$spdk_pid"' EXIT thread_stats() { local thread - local busy_threads=0 + busy_threads=0 get_thread_stats @@ -27,8 +27,6 @@ thread_stats() { printf '%s is idle\n' "${thread_map[thread]}" fi done - - ((busy_threads == 0)) } idle() { @@ -57,6 +55,11 @@ idle() { done thread_stats + + # Allow app_thread is busy for the first sample. Because on some system the dpdk_governor + # initiation process on app_thread is time consuming. This may make the busy time greater + # than idle time which causes the test to fail. + ((samples == 1 && busy_threads <= 1 || samples > 1 && busy_threads == 0)) done xtrace_restore