From db24a2e63a447599b5125da4b6f93f0f9184bfcc Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Fri, 16 Aug 2019 06:47:53 +0000 Subject: FIX: Topology reservation Last attempt [0] is doing more harm then good. If testbed is down but recovered quickly enough (reboot, temporary ssh connectivity issue, ...) it never gets back into pool making other testbeds overloaded and queued. This patch is suppose to partially revert previous behavior until proper patch will follow. [0] https://gerrit.fd.io/r/c/csit/+/21148 Signed-off-by: Peter Mikus Change-Id: I8203946d10d3e7dd51e97519d679246b5dae59e3 --- resources/libraries/bash/function/common.sh | 35 ----------------------------- 1 file changed, 35 deletions(-) (limited to 'resources/libraries/bash') diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 4352724924..7a55d56871 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -556,36 +556,6 @@ function installed () { } -function remove_topo () { - - # Remove the argument from list of available topologies. - # - # Just a de-duplicated block of code - # - # Argument: - # - ${1} - The topology item to remove. Required. - # Variable read and re-written: - # - TOPOLOGIES - Array of paths to topologies, with failed cleanups removed. - - set -exuo pipefail - - warn "Testbed ${topo} seems unsuitable, removing from the list." - - # Build new topology array. - # TOPOLOGIES=("${TOPOLOGIES[@]/$topo}") - # does not really work, see: - # https://stackoverflow.com/questions/16860877/remove-an-element-from-a-bash-array - - new_topologies=() - for item in "${TOPOLOGIES[@]}"; do - if [[ "${item}" != "${1}" ]]; then - new_topologies+=("${item}") - fi - done - TOPOLOGIES=("${new_topologies[@]}") -} - - function reserve_and_cleanup_testbed () { # Reserve physical testbed, perform cleanup, register trap to unreserve. @@ -638,11 +608,6 @@ function reserve_and_cleanup_testbed () { fi warn "Testbed cleanup failed: ${topo}" untrap_and_unreserve_testbed "Fail of unreserve after cleanup." - # WORKING_TOPOLOGY is now empty again. - remove_topo "${topo}" - elif [[ "${result}" != "2" ]]; then - # 1 or unexpected return code, testbed is probably unusable. - remove_topo "${topo}" fi # Else testbed is accessible but currently reserved, moving on. done -- cgit 1.2.3-korg