summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2020-05-05 11:29:39 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2020-05-05 13:29:08 +0000
commit95dad9a2079e516ddc870552141e075aa6e4c8e5 (patch)
treea2be94fd612401ea0ff6e8689daf903710a226df /jenkins-helpers.sh
parent9c23692ad251743e1bdcce142b43bc6d4b2e333f (diff)
jenkins-helpers.sh: Fix print_node_with_least_containers
We iterate over $testers as an array of node names, but it is defined as a space-separated string, so we currently iterate only once and $tester contains all the relevant node names instead of only one at a time. This is silent because print_host_for_node considers only its first parameter, which happens to be the first node in the list. This is fine until that node is offline, so we exit the loop with an error during the first iteration. Fix by using $testers as a string variable. Change-Id: I9ffe1253894697f7324d43170e7bf48b566e324b
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index a11d264a..ccfef2de 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -109,7 +109,7 @@ print_node_with_least_containers ()
# Re. --random-sort below: shuffle node list to mitigate races
# when starting multiple containers at the same time
testers=$(print_nodes_in_labels ${tester_labels[*]} | sort --random-sort)
- for tester in "${testers[@]}"; do
+ for tester in $testers; do
ret=0
tester_host=$(print_host_for_node $tester)
load_value=$(timeout 30s ssh ${tester_host} docker ps | wc -l) || ret=$?