summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2017-01-20 15:29:05 -0500
committerVijay Bellur <vbellur@redhat.com>2017-04-09 18:11:05 -0400
commit5512a5723ad22dd099a57c60483eb80e5b2a14c4 (patch)
treec0213bb0cc9df469e8e2e8ec886d546d1f3dc9fc /tests
parent99c8c0b03a3368d81756440ab48091e1f2430a5f (diff)
tests: track EW_RETRIES for debugging
It can often be useful while debugging to know how many times EXPECT_WITHIN had to retry a command before it got the result we were looking for. This patch just adds a variable EW_RETRIES that can be inspected to find this info for the last EXPECT_WITHIN. Change-Id: I1bcb09bb7eb118c3d76c60317ef99e02df6b6ee6 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: https://review.gluster.org/16451 Tested-by: Jeff Darcy <jeff@pl.atyp.us> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/include.rc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 22265755a02..9e6cea4b487 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -330,6 +330,9 @@ function _EXPECT_WITHIN()
local endtime=$(( ${timeout}+`date +%s` ))
+ # We *want* this to be globally visible.
+ EW_RETRIES=0
+
while [ `date +%s` -lt $endtime ]; do
a=$("$@" | tail -1 ; exit ${PIPESTATUS[0]})
## Check command success
@@ -342,6 +345,7 @@ function _EXPECT_WITHIN()
break;
fi
sleep 1;
+ EW_RETRIES=$((EW_RETRIES+1))
done
if [ "x$e" = "x" ] ; then