diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2017-01-20 15:29:05 -0500 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2017-04-09 18:11:05 -0400 |
commit | 5512a5723ad22dd099a57c60483eb80e5b2a14c4 (patch) | |
tree | c0213bb0cc9df469e8e2e8ec886d546d1f3dc9fc /tests/include.rc | |
parent | 99c8c0b03a3368d81756440ab48091e1f2430a5f (diff) | |
download | glusterfs-5512a5723ad22dd099a57c60483eb80e5b2a14c4.tar.gz glusterfs-5512a5723ad22dd099a57c60483eb80e5b2a14c4.tar.xz glusterfs-5512a5723ad22dd099a57c60483eb80e5b2a14c4.zip |
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/include.rc')
-rw-r--r-- | tests/include.rc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc index 22265755a0..9e6cea4b48 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 |