@@ -98,7 +98,7 @@ func PostgreSQLReplicationTestFactory(oc *exutil.CLI, image string) func() {
98
98
exutil .DumpApplicationPodLogs ("postgresql-master" , oc )
99
99
exutil .DumpApplicationPodLogs ("postgresql-slave" , oc )
100
100
}
101
- o .Expect ( err ).NotTo (o .HaveOccurred ())
101
+ o .ExpectWithOffset ( 1 , err ).NotTo (o .HaveOccurred ())
102
102
}
103
103
104
104
tableCounter ++
@@ -110,7 +110,7 @@ func PostgreSQLReplicationTestFactory(oc *exutil.CLI, image string) func() {
110
110
exutil .DumpApplicationPodLogs ("postgresql-master" , oc )
111
111
exutil .DumpApplicationPodLogs ("postgresql-helper" , oc )
112
112
}
113
- o .Expect ( err ).NotTo (o .HaveOccurred ())
113
+ o .ExpectWithOffset ( 1 , err ).NotTo (o .HaveOccurred ())
114
114
115
115
err = exutil .WaitUntilAllHelpersAreUp (oc , slaves )
116
116
check (err )
@@ -153,19 +153,32 @@ func PostgreSQLReplicationTestFactory(oc *exutil.CLI, image string) func() {
153
153
err = oc .Run ("env" ).Args ("dc" , "postgresql-master" , "POSTGRESQL_ADMIN_PASSWORD=newpass" ).Execute ()
154
154
o .Expect (err ).NotTo (o .HaveOccurred ())
155
155
err = exutil .WaitUntilPodIsGone (oc .KubeClient ().CoreV1 ().Pods (oc .Namespace ()), master .PodName (), 1 * time .Minute )
156
+ if err != nil {
157
+ e2e .Logf ("Checking if pod %s still exists" , master .PodName ())
158
+ oc .Run ("get" ).Args ("pod" , master .PodName (), "-o" , "yaml" )
159
+ }
160
+ o .Expect (err ).NotTo (o .HaveOccurred ())
156
161
master , _ , _ = assertReplicationIsWorking ("postgresql-master-2" , "postgresql-slave-1" , 1 )
157
162
158
163
g .By ("after master is restarted by deleting the pod" )
159
164
err = oc .Run ("delete" ).Args ("pod" , "-l" , "deployment=postgresql-master-2" ).Execute ()
160
165
o .Expect (err ).NotTo (o .HaveOccurred ())
161
166
err = exutil .WaitUntilPodIsGone (oc .KubeClient ().CoreV1 ().Pods (oc .Namespace ()), master .PodName (), 1 * time .Minute )
167
+ if err != nil {
168
+ e2e .Logf ("Checking if pod %s still exists" , master .PodName ())
169
+ oc .Run ("get" ).Args ("pod" , master .PodName (), "-o" , "yaml" )
170
+ }
162
171
o .Expect (err ).NotTo (o .HaveOccurred ())
163
172
_ , slaves , _ := assertReplicationIsWorking ("postgresql-master-2" , "postgresql-slave-1" , 1 )
164
173
165
174
g .By ("after slave is restarted by deleting the pod" )
166
175
err = oc .Run ("delete" ).Args ("pod" , "-l" , "deployment=postgresql-slave-1" ).Execute ()
167
176
o .Expect (err ).NotTo (o .HaveOccurred ())
168
177
err = exutil .WaitUntilPodIsGone (oc .KubeClient ().CoreV1 ().Pods (oc .Namespace ()), slaves [0 ].PodName (), 1 * time .Minute )
178
+ if err != nil {
179
+ e2e .Logf ("Checking if pod %s still exists" , slaves [0 ].PodName ())
180
+ oc .Run ("get" ).Args ("pod" , slaves [0 ].PodName (), "-o" , "yaml" )
181
+ }
169
182
o .Expect (err ).NotTo (o .HaveOccurred ())
170
183
assertReplicationIsWorking ("postgresql-master-2" , "postgresql-slave-1" , 1 )
171
184
@@ -177,6 +190,10 @@ func PostgreSQLReplicationTestFactory(oc *exutil.CLI, image string) func() {
177
190
err = oc .Run ("scale" ).Args ("dc" , "postgresql-slave" , "--replicas=0" ).Execute ()
178
191
o .Expect (err ).NotTo (o .HaveOccurred ())
179
192
err = exutil .WaitUntilPodIsGone (oc .KubeClient ().CoreV1 ().Pods (oc .Namespace ()), pods .Items [0 ].Name , 1 * time .Minute )
193
+ if err != nil {
194
+ e2e .Logf ("Checking if pod %s still exists" , pods .Items [0 ].Name )
195
+ oc .Run ("get" ).Args ("pod" , pods .Items [0 ].Name , "-o" , "yaml" )
196
+ }
180
197
o .Expect (err ).NotTo (o .HaveOccurred ())
181
198
err = oc .Run ("scale" ).Args ("dc" , "postgresql-slave" , "--replicas=4" ).Execute ()
182
199
o .Expect (err ).NotTo (o .HaveOccurred ())
0 commit comments