From 3ed02d9a9a9d757dfa7470ac64b8c7bbb2078a13 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 19 Jan 2017 10:06:32 +0000 Subject: [PATCH] Make integration tests more robust --- integration/config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/config.sh b/integration/config.sh index 05586e011..3014243c2 100644 --- a/integration/config.sh +++ b/integration/config.sh @@ -71,8 +71,8 @@ has_connection_by_id() { for i in $(seq "$timeout"); do local nodes local edge - edge=$(echo "$nodes" | jq -r ".nodes[\"$from_id\"].adjacency | contains([\"$to_id\"])" 2>/dev/null) - nodes="$(curl -s "http://$host:4040/api/topology/${view}?system=show")" + edge=$(echo "$nodes" | (jq -r ".nodes[\"$from_id\"].adjacency | contains([\"$to_id\"])" || true) 2>/dev/null) + nodes=$(curl -s "http://$host:4040/api/topology/${view}?system=show" || true) if [ "$edge" = "true" ]; then echo "Found edge $from -> $to after $i secs" assert "curl -s http://$host:4040/api/topology/${view}?system=show | jq -r '.nodes[\"$from_id\"].adjacency | contains([\"$to_id\"])'" true @@ -109,7 +109,7 @@ wait_for() { for i in $(seq "${timeout}"); do local nodes local found=0 - nodes="$(curl -s "http://$host:4040/api/topology/${view}?system=show")" + nodes=$(curl -s "http://$host:4040/api/topology/${view}?system=show" || true) for name in "$@"; do local count count=$(echo "${nodes}" | jq -r "[.nodes[] | select(.label == \"${name}\")] | length")