From c160e972ab8b2f253cd147e4a02f1ade11f0d75a Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Tue, 6 Apr 2021 15:24:56 +0800 Subject: [PATCH] qa: retry cloning the ceph.git The cloning may take a very long time, 2.5 hours for example, usally it should be done in server minutes. If it really very slow, there maybe something wrong with the current socket connections, retry it maybe fixed. This fixing will timeout the clone command after 30m, and retry it by doubling the timeout value. Fixes: https://tracker.ceph.com/issues/50021 Signed-off-by: Xiubo Li --- qa/workunits/fs/snaps/snaptest-git-ceph.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qa/workunits/fs/snaps/snaptest-git-ceph.sh b/qa/workunits/fs/snaps/snaptest-git-ceph.sh index 0d11efedb73d4..e203fd8823fe2 100755 --- a/qa/workunits/fs/snaps/snaptest-git-ceph.sh +++ b/qa/workunits/fs/snaps/snaptest-git-ceph.sh @@ -2,7 +2,17 @@ set -e -git clone git://git.ceph.com/ceph.git +# try it again if the clone is slow and the second time +retried=false +trap -- 'retry' EXIT +retry() { + rm -rf ceph + # double the timeout value + timeout 3600 git clone git://git.ceph.com/ceph.git +} +rm -rf ceph +timeout 1800 git clone git://git.ceph.com/ceph.git +trap - EXIT cd ceph versions=`seq 1 21` -- 2.39.5