@@ -37,12 +37,14 @@ var _ = Describe("Test governance-policy-database secret changes and DB annotati
37
37
nsName := fmt .Sprintf ("case20-%d" , seededRand .Int31 ())
38
38
39
39
createCase20Policy := func (ctx context.Context ) {
40
+ GinkgoHelper ()
41
+
40
42
By ("Creating " + case20PolicyName )
41
43
utils .Kubectl ("apply" , "-f" , case20PolicyYAML , "-n" , nsName , "--kubeconfig=" + kubeconfigHub )
42
44
plc := utils .GetWithTimeout (
43
45
clientHubDynamic , gvrPolicy , case20PolicyName , nsName , true , defaultTimeoutSeconds ,
44
46
)
45
- ExpectWithOffset ( 1 , plc ).NotTo (BeNil ())
47
+ Expect ( plc ).NotTo (BeNil ())
46
48
47
49
By ("Patching the placement with decision of cluster local-cluster" )
48
50
pld := utils .GetWithTimeout (
@@ -57,13 +59,13 @@ var _ = Describe("Test governance-policy-database secret changes and DB annotati
57
59
_ , err := clientHubDynamic .Resource (gvrPlacementDecision ).Namespace (nsName ).UpdateStatus (
58
60
ctx , pld , metav1.UpdateOptions {},
59
61
)
60
- ExpectWithOffset ( 1 , err ).ToNot (HaveOccurred ())
62
+ Expect ( err ).ToNot (HaveOccurred ())
61
63
62
64
By ("Waiting for the replicated policy" )
63
65
replicatedPolicy := utils .GetWithTimeout (
64
66
clientHubDynamic , gvrPolicy , case20PolicyName , nsName , true , defaultTimeoutSeconds ,
65
67
)
66
- ExpectWithOffset ( 1 , replicatedPolicy ).NotTo (BeNil ())
68
+ Expect ( replicatedPolicy ).NotTo (BeNil ())
67
69
}
68
70
69
71
BeforeAll (func (ctx context.Context ) {
@@ -144,8 +146,10 @@ var _ = Describe("Test governance-policy-database secret changes and DB annotati
144
146
})
145
147
146
148
func bringDownDBConnection (ctx context.Context ) {
149
+ GinkgoHelper ()
150
+
147
151
By ("Setting the port to 12345" )
148
- EventuallyWithOffset ( 1 , func (g Gomega ) {
152
+ Eventually ( func (g Gomega ) {
149
153
namespacedSecret := clientHub .CoreV1 ().Secrets ("open-cluster-management" )
150
154
secret , err := namespacedSecret .Get (
151
155
ctx , complianceeventsapi .DBSecretName , metav1.GetOptions {},
@@ -159,7 +163,7 @@ func bringDownDBConnection(ctx context.Context) {
159
163
}, defaultTimeoutSeconds , 1 ).Should (Succeed ())
160
164
161
165
By ("Waiting for the database connection to be down" )
162
- EventuallyWithOffset ( 1 , func (g Gomega ) {
166
+ Eventually ( func (g Gomega ) {
163
167
req , err := http .NewRequestWithContext (
164
168
ctx , http .MethodGet , fmt .Sprintf ("https://localhost:%d/api/v1/compliance-events/1" , complianceAPIPort ), nil ,
165
169
)
@@ -189,8 +193,10 @@ func bringDownDBConnection(ctx context.Context) {
189
193
}
190
194
191
195
func restoreDBConnection (ctx context.Context ) {
196
+ GinkgoHelper ()
197
+
192
198
By ("Restoring the database connection" )
193
- EventuallyWithOffset ( 1 , func (g Gomega ) {
199
+ Eventually ( func (g Gomega ) {
194
200
namespacedSecret := clientHub .CoreV1 ().Secrets ("open-cluster-management" )
195
201
secret , err := namespacedSecret .Get (
196
202
ctx , complianceeventsapi .DBSecretName , metav1.GetOptions {},
@@ -208,7 +214,7 @@ func restoreDBConnection(ctx context.Context) {
208
214
}, defaultTimeoutSeconds , 1 ).Should (Succeed ())
209
215
210
216
By ("Waiting for the database connection to be up" )
211
- EventuallyWithOffset ( 1 , func (g Gomega ) {
217
+ Eventually ( func (g Gomega ) {
212
218
req , err := http .NewRequestWithContext (
213
219
ctx ,
214
220
http .MethodGet ,
0 commit comments