@@ -4,6 +4,9 @@ metadata:
44 name : failover
55spec :
66 description : Service failover test case
7+ bindings :
8+ - name : ocWaitTimeout
9+ value : 160s
710 steps :
811 - name : Setup
912 description : Deploy a cluster and a background pod with long-running DB connection
@@ -32,14 +35,16 @@ spec:
3235 value : ($stdout)
3336 - script :
3437 env :
38+ - name : WAIT_TIMEOUT
39+ value : ($ocWaitTimeout)
3540 - name : PASSWORD
3641 value : ($db_password)
3742 - name : IMAGE
3843 value : ($pod_image)
3944 skipLogOutput : true
4045 content : |
4146 oc -n $NAMESPACE run failover-check --image=$IMAGE --env="DB_ROOT_PASSWORD=$PASSWORD" --command -- dumb-init bash -c "$(cat ../../scripts/connect.sh)"
42- oc -n $NAMESPACE wait --for=jsonpath='{.status.phase}'=Running pod failover-check
47+ oc -n $NAMESPACE wait --for=jsonpath='{.status.phase}'=Running --timeout=${WAIT_TIMEOUT} pod failover-check
4348
4449 cleanup :
4550 - delete :
@@ -58,11 +63,13 @@ spec:
5863 - name : endpoint
5964 value : ($stdout)
6065 - script :
61- env :
66+ env : &wait_env
67+ - name : WAIT_TIMEOUT
68+ value : ($ocWaitTimeout)
6269 - name : ENDPOINT
6370 value : ($endpoint)
6471 content : |
65- oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 statefulset openstack-galera
72+ oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 --timeout=${WAIT_TIMEOUT} statefulset openstack-galera
6673 oc delete -n $NAMESPACE --wait pod $ENDPOINT
6774 - script :
6875 content : *endpoint_cmd
8592 try :
8693 - script : *get_endpoint
8794 - script :
88- env :
89- - name : ENDPOINT
90- value : ($endpoint)
95+ env : *wait_env
9196 content : |
92- oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 statefulset openstack-galera
97+ oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 --timeout=${WAIT_TIMEOUT} statefulset openstack-galera
9398 current=$ENDPOINT
9499 oc rsh -n $NAMESPACE $ENDPOINT killall -s STOP /usr/libexec/mysqld
95100 while [ "$current" = "$ENDPOINT" ]; do
@@ -109,11 +114,9 @@ spec:
109114 try :
110115 - script : *get_endpoint
111116 - script :
112- env :
113- - name : ENDPOINT
114- value : ($endpoint)
117+ env : *wait_env
115118 content : |
116- oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 statefulset openstack-galera
119+ oc wait -n $NAMESPACE --for=jsonpath='{.status.readyReplicas}'=3 --timeout=${WAIT_TIMEOUT} statefulset openstack-galera
117120 echo -ne openstack-galera-{0,1,2}\\n | grep -v $ENDPOINT | head -1 | xargs oc delete --wait -n $NAMESPACE --wait pod
118121 - script :
119122 content : *endpoint_cmd
0 commit comments