Browse Source

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
Andrey Volkov 6 months ago
parent
commit
38634f1aa6
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      tools/gate/scripts/020-test-divingbell.sh

+ 2
- 3
tools/gate/scripts/020-test-divingbell.sh View File

@@ -151,11 +151,11 @@ dry_run(){
151 151
 
152 152
 get_container_status(){
153 153
   local deployment="${1}"
154
-  container="$(kubectl get pods --namespace="${NAME}" | grep ${NAME}-${deployment} | cut -d' ' -f1)"
155
-  local log_connect_timeout=30
154
+  local log_connect_timeout=60
156 155
   local log_connect_sleep_interval=2
157 156
   local wait_time=0
158 157
   while : ; do
158
+    container="$(kubectl get pods --namespace="${NAME}" | grep ${NAME}-${deployment} | grep -v Terminating | cut -d' ' -f1)"
159 159
     kubectl logs "${container}" --namespace="${NAME}" > /dev/null && break || \
160 160
       echo "Waiting for container logs..." && \
161 161
       wait_time=$((${wait_time} + ${log_connect_sleep_interval})) && \
@@ -987,4 +987,3 @@ test_overrides
987 987
 init_default_state
988 988
 
989 989
 echo "All tests pass for ${NAME}"
990
-

Loading…
Cancel
Save