Commit 5fb5e91e authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

test/common: reduce waitforserial sleep

NVMe-oF initiator in recent kernel versions takes
considerably less time than when the "sleep 4" was
introduced, as described in:
https://github.com/spdk/spdk/issues/2467



This effectively reverts:
dacd8ec8

Change-Id: Ib678d99c330c739788a5d6aaeabd23cb2c9017ef
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15989


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 9e96e331
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1136,11 +1136,8 @@ function waitforserial() {
		nvme_device_counter=$2
	fi

	# Wait initially for min 4s to make sure all devices are ready for use. It seems
	# that we may be racing with a kernel where in some cases immediate disconnect may
	# leave dangling subsystem with no-op block devices which can't be used nor removed
	# (unless kernel is rebooted) and which start to negatively affect all the tests.
	sleep 4
	# Wait initially for min 2s to make sure all devices are ready for use.
	sleep 2
	while ((i++ <= 15)); do
		nvme_devices=$(lsblk -l -o NAME,SERIAL | grep -c "$1")
		((nvme_devices == nvme_device_counter)) && return 0