Commit 692fce32 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/common: Introduce timeout in discover_bdevs()

In case something goes awfully wrong with the test which calls this
particular function, e.g:

  https://ci.spdk.io/results/autotest-per-patch/builds/4787



the CI's autotest runs may be blocked for max of 15 minutes before
failing the build. Instead, introduce internal timeout for the
routine itself (default of 30s) and fail the test sooner when it
expires.

Change-Id: I2c792c1781987e80e34c1fa19ec3eef43c25e38a
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1026


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent ba5329d3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -762,6 +762,7 @@ function discover_bdevs()
	local rootdir=$1
	local config_file=$2
	local cfg_type=$3
	local wait_for_spdk_bdev=${4:-30}
	local rpc_server=/var/tmp/spdk-discover-bdevs.sock

	if [ ! -e $config_file ]; then
@@ -779,6 +780,8 @@ function discover_bdevs()
		$cfg_type $config_file &>/dev/null &
	stubpid=$!
	while ! [ -e /var/run/spdk_bdev0 ]; do
		# If this counter drops to zero, errexit will be caught to abort the test
		(( wait_for_spdk_bdev-- ))
		sleep 1
	done