From: Ian Rogers Date: Wed, 17 Mar 2021 00:55:05 +0000 (-0700) Subject: perf test: Add 30s timeout for wait for daemon start. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a6cb06ff49fd522aaeecfee7d5952ac6e2ab9d13;p=linux.git perf test: Add 30s timeout for wait for daemon start. Retry the ping loop upto 600 times, or approximately 30 seconds, to make sure the test does hang at start up. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210317005505.2794804-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh index 61d13c4c64b8d..ee4a30ca3f571 100755 --- a/tools/perf/tests/shell/daemon.sh +++ b/tools/perf/tests/shell/daemon.sh @@ -127,9 +127,16 @@ daemon_start() # wait for the session to ping local state="FAIL" + local retries=0 while [ "${state}" != "OK" ]; do state=`perf daemon ping --config ${config} --session ${session} | awk '{ print $1 }'` sleep 0.05 + retries=$((${retries} +1)) + if [ ${retries} -ge 600 ]; then + echo "FAILED: Timeout waiting for daemon to ping" + daemon_exit ${config} + exit 1 + fi done }