Skip to content

Commit 91df0df

Browse files
committed
test: Add sleep, move assertions
This brief sleep ensures that the Pod rotation has started before the assertion (for readyReplicas) is run. Previously, the assertion succeeded before the version upgrade was done and as such, the 07 assertion failed.
1 parent b404881 commit 91df0df

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

tests/templates/kuttl/upgrade/04-assert.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: kuttl.dev/v1beta1
33
kind: TestAssert
44
timeout: 300
55
commands:
6+
# - script: kubectl wait -n $NAMESPACE --for='jsonpath={.status.readyReplicas}=3' sts/test-nifi-node-default --timeout=60s
67
- script: kubectl exec -n $NAMESPACE test-nifi-0 -- python /tmp/test_nifi.py -u admin -p supersecretpassword -n $NAMESPACE -c 3
78
- script: kubectl exec -n $NAMESPACE test-nifi-0 -- sh -c "python /tmp/flow.py > /tmp/old_input"
89
# This tests if the output contains an Error or zero flow files are queued, which also indicates that something went wrong
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
# Sleep for a little while to ensure the pod rotation of the NiFi cluster has started. Otherwise,
6+
# the assertion in 06 will immediately succeed because it is run _before_ the pod rotation has
7+
# started.
8+
- script: sleep 15

tests/templates/kuttl/upgrade/07-assert.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
name: test-nifi-updated
66
timeout: 300
77
commands:
8+
# - script: kubectl wait -n $NAMESPACE --for='jsonpath={.status.readyReplicas}=3' sts/test-nifi-node-default --timeout=60s
89
- script: kubectl exec -n $NAMESPACE test-nifi-0 -- python /tmp/test_nifi.py -u admin -p supersecretpassword -n $NAMESPACE -c 3
910
- script: kubectl exec -n $NAMESPACE test-nifi-0 -- sh -c "python /tmp/flow.py -e https://test-nifi-node-default-0.test-nifi-node-default-headless.$NAMESPACE.svc.cluster.local:8443 query > /tmp/new_input"
1011
# This tests if the output contains an Error or zero flow files are queued, which also indicates that something went wrong

0 commit comments

Comments
 (0)