From 5466d5d4dc5bfa033b7621311babb82eab37b245 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Sun, 5 Sep 2021 16:01:17 +0900 Subject: [PATCH] test/nvmf: Extend ANA state change timeout to 20 seconds If a connection is lost, Linux NVMe host tries reconnecting after 10 seconds delay by default. To cover this case, extend the timeout to 20 seconds. Usually Linux NVMe host recognizes the new ANA state within 2 seconds. This patch is for the github issue #2081 Signed-off-by: Shuhei Matsumoto Change-Id: I61fba2febcea81951c8b29f940d93863bc31b332 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9393 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk --- test/nvmf/target/multipath.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/nvmf/target/multipath.sh b/test/nvmf/target/multipath.sh index d58293bec1..9134827136 100755 --- a/test/nvmf/target/multipath.sh +++ b/test/nvmf/target/multipath.sh @@ -14,7 +14,10 @@ function check_ana_state() { local subsys_id=$1 local ctrl_id=$2 local ana_state=$3 - local timeout=3 + # Very rarely a connection is lost and Linux NVMe host tries reconnecting + # after 10 seconds delay. For this case, set a sufficienntly long timeout. + # Linux NVMe host usually recognizes the new ANA state within 2 seconds. + local timeout=20 while [ $(cat /sys/block/nvme"$subsys_id"c"$ctrl_id"n1/ana_state) != "$ana_state" ]; do sleep 1