Skip to content

Commit a66221c

Browse files
committed
fixes
1 parent 4f10e46 commit a66221c

24 files changed

+154
-56
lines changed

e2e-tests/tests/major-upgrade/01-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: kuttl.dev/v1beta1
22
kind: TestAssert
3-
timeout: 120
3+
timeout: 240
44
---
55
kind: StatefulSet
66
apiVersion: apps/v1

e2e-tests/tests/major-upgrade/02-write-data.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ commands:
1010
run_psql_local \
1111
'CREATE DATABASE myapp; \c myapp \\\ CREATE TABLE IF NOT EXISTS myApp (id int PRIMARY KEY);' \
1212
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"
13-
13+
1414
run_psql_local \
1515
'\c myapp \\\ INSERT INTO myApp (id) VALUES (100500)' \
1616
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"
1717
1818
run_psql_local \
1919
'\c postgres \\\ CREATE EXTENSION pg_cron' \
20-
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"
20+
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"

e2e-tests/tests/major-upgrade/10-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: kuttl.dev/v1beta1
22
kind: TestAssert
3-
timeout: 360
3+
timeout: 600
44
commands:
55
- script: |-
66
kubectl -n ${NAMESPACE} get pg,pod,job

e2e-tests/tests/major-upgrade/41-wait.yaml renamed to e2e-tests/tests/major-upgrade/11-wait-and-write-data.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ commands:
66
set -o errexit
77
set -o xtrace
88
9-
sleep 300
9+
source ../../functions
10+
11+
sleep 90 # wait some time for stanza to upgrade
1012
1113
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
1214
echo "Checking the status of ${pod}:"
1315
kubectl -n ${NAMESPACE} exec -it ${pod} -- psql -c "SELECT version()"
1416
kubectl -n ${NAMESPACE} exec -it ${pod} -- psql -c "SELECT timeline_id FROM pg_control_checkpoint()"
1517
kubectl -n ${NAMESPACE} exec -it ${pod} -- pgbackrest --stanza=db --log-level-console=detail check
18+
kubectl -n ${NAMESPACE} exec -it ${pod} -- ls -l /pgdata/pg13_wal/
1619
done
20+
21+
run_psql_local \
22+
'\c myapp \\\ INSERT INTO myApp (id) VALUES (100501)' \
23+
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"
24+

e2e-tests/tests/major-upgrade/13-wait.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ kind: TestStep
33
commands:
44
- timeout: 600
55
script: |-
6-
set -o errexit
7-
set -o xtrace
8-
9-
sleep 30
6+
sleep 60
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
apiVersion: pgv2.percona.com/v2
2-
kind: PerconaPGRestore
3-
metadata:
4-
name: restore-after-12-to-13
5-
spec:
6-
pgCluster: major-upgrade
7-
repoName: repo1
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- timeout: 600
6+
script: |-
7+
set -o errexit
8+
set -o xtrace
9+
10+
backup_name=$(kubectl -n ${NAMESPACE} get pg-backup backup-after-12-to-13 -o jsonpath={.status.backupName})
11+
12+
cat <<-EOF | kubectl -n ${NAMESPACE} apply -f -
13+
apiVersion: pgv2.percona.com/v2
14+
kind: PerconaPGRestore
15+
metadata:
16+
name: restore-after-12-to-13
17+
spec:
18+
pgCluster: major-upgrade
19+
repoName: repo1
20+
options:
21+
- --set=${backup_name}
22+
EOF

e2e-tests/tests/major-upgrade/19-assert.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ timeout: 30
55
kind: ConfigMap
66
apiVersion: v1
77
metadata:
8-
name: 05-read-from-primary
8+
name: 19-read-from-primary
99
data:
10-
data: ' 100500'
10+
data: |2-
11+
100500
12+
100501

e2e-tests/tests/major-upgrade/19-read-from-primary.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ commands:
99
source ../../functions
1010
data=$(run_psql_local '\c myapp \\\ SELECT * from myApp;' "postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)")
1111
12-
kubectl create configmap -n "${NAMESPACE}" 05-read-from-primary --from-literal=data="${data}"
12+
kubectl create configmap -n "${NAMESPACE}" 19-read-from-primary --from-literal=data="${data}"

e2e-tests/tests/major-upgrade/31-wait.yaml renamed to e2e-tests/tests/major-upgrade/21-wait-and-write-data.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ commands:
66
set -o errexit
77
set -o xtrace
88
9-
sleep 300
9+
source ../../functions
10+
11+
sleep 90 # wait some time for stanza to upgrade
1012
1113
for pod in $(kubectl -n ${NAMESPACE} get pods -l postgres-operator.crunchydata.com/data=postgres --no-headers | awk '{print $1}'); do
1214
echo "Checking the status of ${pod}:"
1315
kubectl -n ${NAMESPACE} exec -it ${pod} -- psql -c "SELECT version()"
1416
kubectl -n ${NAMESPACE} exec -it ${pod} -- psql -c "SELECT timeline_id FROM pg_control_checkpoint()"
1517
kubectl -n ${NAMESPACE} exec -it ${pod} -- pgbackrest --stanza=db --log-level-console=detail check
18+
kubectl -n ${NAMESPACE} exec -it ${pod} -- ls -l /pgdata/pg14_wal
1619
done
20+
21+
run_psql_local \
22+
'\c myapp \\\ INSERT INTO myApp (id) VALUES (100502)' \
23+
"postgres:$(get_psql_user_pass major-upgrade-pguser-postgres)@$(get_psql_user_host major-upgrade-pguser-postgres)"
24+

e2e-tests/tests/major-upgrade/23-wait.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ kind: TestStep
33
commands:
44
- timeout: 600
55
script: |-
6-
sleep 30
6+
sleep 60

0 commit comments

Comments
 (0)