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
This commit is contained in:
Andrey Volkov 2018-10-02 09:10:06 -07:00
parent d734925bb6
commit 38634f1aa6
1 changed files with 2 additions and 3 deletions

View File

@ -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}"