Skip to content

Commit

Permalink
ci: Change vagrant timeout mechanism
Browse files Browse the repository at this point in the history
Due to bug in jenkins, nesting timeout in retry block causes build to
abort. Work around by using shell-based timeout

Signed-off-by: Maciej Kwiek <maciej@isovalent.com>
  • Loading branch information
nebril authored and borkmann committed Jun 3, 2020
1 parent bdf98cb commit 03602e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
18 changes: 6 additions & 12 deletions jenkinsfiles/ginkgo.Jenkinsfile
Expand Up @@ -126,10 +126,8 @@ pipeline {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 30, unit: 'MINUTES'){
sh 'cd ${TESTDIR}; vagrant destroy runtime --force'
sh 'cd ${TESTDIR}; vagrant up runtime --provision'
}
sh 'cd ${TESTDIR}; vagrant destroy runtime --force'
sh 'cd ${TESTDIR}; timeout 30m vagrant up runtime --provision'
}
}
post {
Expand Down Expand Up @@ -158,10 +156,8 @@ pipeline {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 45, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" timeout 45m ./vagrant-ci-start.sh'
}
}
}
Expand All @@ -187,10 +183,8 @@ pipeline {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 45, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" timeout 45m ./vagrant-ci-start.sh'
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions jenkinsfiles/kubernetes-upstream.Jenkinsfile
Expand Up @@ -78,17 +78,14 @@ pipeline {
}
stage('Boot VMs'){
options {
timeout(time: 60, unit: 'MINUTES')
timeout(time: 70, unit: 'MINUTES')
}

steps {
retry(3){
timeout(time: 20, unit: 'MINUTES'){
sh 'cd ${TESTDIR}; vagrant destroy k8s1-${K8S_VERSION} --force'
sh 'cd ${TESTDIR}; vagrant destroy k8s2-${K8S_VERSION} --force'
sh 'cd ${TESTDIR}; vagrant up k8s1-${K8S_VERSION}'
sh 'cd ${TESTDIR}; vagrant up k8s2-${K8S_VERSION}'
}
sh 'cd ${TESTDIR}; vagrant destroy k8s1-${K8S_VERSION} --force'
sh 'cd ${TESTDIR}; vagrant destroy k8s2-${K8S_VERSION} --force'
sh 'cd ${TESTDIR}; timeout 20m vagrant up k8s1-${K8S_VERSION} k8s2-${K8S_VERSION}'
}
}
}
Expand Down

0 comments on commit 03602e3

Please sign in to comment.