From 38634f1aa6c9c6c60d7c94bde7ef743b4b6915af Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Tue, 2 Oct 2018 09:10:06 -0700 Subject: [PATCH] Improve test stability See false positive in I234a50e9b2e46d5c92a89eb8073771043b4eaf56. This patch makes the following changes to improve gate stability: - Increase timeout while waiting for container logs from 30 to 60. - Exclude terminating containers and get container name on each iteration. NAME READY STATUS RESTARTS AGE divingbell-apparmor-default-984mc 0/1 Terminating 0 26s divingbell-apparmor-default-splhc 0/1 ContainerCreating 0 8s divingbell-ethtool-default-62dlt 0/1 ContainerCreating 0 8s divingbell-ethtool-default-v975n 0/1 Terminating 0 26s divingbell-mounts-default-2xhv5 0/1 ContainerCreating 0 8s divingbell-sysctl-default-c8nhn 0/1 Pending 0 8s divingbell-sysctl-default-mlsnp 0/1 Terminating 0 26s divingbell-uamlite-default-dv9cv 0/1 Pending 0 8s Change-Id: I35ba6844d41c92bf9f581a97218275363e9ee0bd --- tools/gate/scripts/020-test-divingbell.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/gate/scripts/020-test-divingbell.sh b/tools/gate/scripts/020-test-divingbell.sh index 22c3347..d17d69d 100755 --- a/tools/gate/scripts/020-test-divingbell.sh +++ b/tools/gate/scripts/020-test-divingbell.sh @@ -151,11 +151,11 @@ dry_run(){ get_container_status(){ local deployment="${1}" - container="$(kubectl get pods --namespace="${NAME}" | grep ${NAME}-${deployment} | cut -d' ' -f1)" - local log_connect_timeout=30 + local log_connect_timeout=60 local log_connect_sleep_interval=2 local wait_time=0 while : ; do + container="$(kubectl get pods --namespace="${NAME}" | grep ${NAME}-${deployment} | grep -v Terminating | cut -d' ' -f1)" kubectl logs "${container}" --namespace="${NAME}" > /dev/null && break || \ echo "Waiting for container logs..." && \ wait_time=$((${wait_time} + ${log_connect_sleep_interval})) && \ @@ -987,4 +987,3 @@ test_overrides init_default_state echo "All tests pass for ${NAME}" -