Retry the ping loop upto 600 times, or approximately 30 seconds, to make sure the test does hang at start up.
Unified · Split
| @@ -127,9 +127,16 @@ daemon_start() · 126 unmodified lines | |||
| 127 | 127 | ||
| 128 | # wait for the session to ping | 128 | # wait for the session to ping |
| 129 | local state="FAIL" | 129 | local state="FAIL" |
| 130 | local retries=0 | ||
| 130 | while [ "${state}" != "OK" ]; do | 131 | while [ "${state}" != "OK" ]; do |
| 131 | state=`perf daemon ping --config ${config} --session ${session} | awk '{ print $1 }'` | 132 | state=`perf daemon ping --config ${config} --session ${session} | awk '{ print $1 }'` |
| 132 | sleep 0.05 | 133 | sleep 0.05 |
| 134 | retries=$((${retries} +1)) | ||
| 135 | if [ ${retries} -ge 600 ]; then | ||
| 136 | echo "FAILED: Timeout waiting for daemon to ping" | ||
| 137 | daemon_exit ${config} | ||
| 138 | exit 1 | ||
| 139 | fi | ||
| 133 | done | 140 | done |
| 134 | } | 141 | } |
| 135 | 142 | ||