@@ -36,11 +36,7 @@ var _ = Describe("Graceful Recovery test", Ordered, Label("nfr", "graceful-recov
36
36
"graceful-recovery/cafe-routes.yaml" ,
37
37
}
38
38
39
- ns := & core.Namespace {
40
- ObjectMeta : metav1.ObjectMeta {
41
- Name : "graceful-recovery" ,
42
- },
43
- }
39
+ var ns core.Namespace
44
40
45
41
teaURL := "https://cafe.example.com/tea"
46
42
coffeeURL := "http://cafe.example.com/coffee"
@@ -63,7 +59,13 @@ var _ = Describe("Graceful Recovery test", Ordered, Label("nfr", "graceful-recov
63
59
})
64
60
65
61
BeforeEach (func () {
66
- Expect (resourceManager .Apply ([]client.Object {ns })).To (Succeed ())
62
+ ns = core.Namespace {
63
+ ObjectMeta : metav1.ObjectMeta {
64
+ Name : "graceful-recovery" ,
65
+ },
66
+ }
67
+
68
+ Expect (resourceManager .Apply ([]client.Object {& ns })).To (Succeed ())
67
69
Expect (resourceManager .ApplyFromFiles (files , ns .Name )).To (Succeed ())
68
70
Expect (resourceManager .WaitForAppsToBeReady (ns .Name )).To (Succeed ())
69
71
@@ -82,13 +84,13 @@ var _ = Describe("Graceful Recovery test", Ordered, Label("nfr", "graceful-recov
82
84
})
83
85
84
86
It ("recovers when NGF container is restarted" , func () {
85
- runRecoveryTest (teaURL , coffeeURL , ngfPodName , ngfContainerName , files , ns )
87
+ runRecoveryTest (teaURL , coffeeURL , ngfPodName , ngfContainerName , files , & ns )
86
88
})
87
89
88
90
It ("recovers when nginx container is restarted" , func () {
89
91
// FIXME(bjee19) remove Skip() when https://github.com./nginxinc/nginx-gateway-fabric/issues/1108 is completed.
90
92
Skip ("Test currently fails due to this issue: https://github.com./nginxinc/nginx-gateway-fabric/issues/1108" )
91
- runRecoveryTest (teaURL , coffeeURL , ngfPodName , nginxContainerName , files , ns )
93
+ runRecoveryTest (teaURL , coffeeURL , ngfPodName , nginxContainerName , files , & ns )
92
94
})
93
95
})
94
96
@@ -206,10 +208,10 @@ func checkForWorkingTraffic(teaURL, coffeeURL string) error {
206
208
}
207
209
208
210
func checkForFailingTraffic (teaURL , coffeeURL string ) error {
209
- if err := expectRequestToFail (teaURL , address , "URI: /tea" ); err != nil {
211
+ if err := expectRequestToFail (teaURL , address ); err != nil {
210
212
return err
211
213
}
212
- if err := expectRequestToFail (coffeeURL , address , "URI: /coffee" ); err != nil {
214
+ if err := expectRequestToFail (coffeeURL , address ); err != nil {
213
215
return err
214
216
}
215
217
return nil
@@ -228,7 +230,7 @@ func expectRequestToSucceed(appURL, address string, responseBodyMessage string)
228
230
return err
229
231
}
230
232
231
- func expectRequestToFail (appURL , address string , responseBodyMessage string ) error {
233
+ func expectRequestToFail (appURL , address string ) error {
232
234
status , body , err := framework .Get (appURL , address , timeoutConfig .RequestTimeout )
233
235
if status != 0 {
234
236
return errors .New ("expected http status to be 0" )
0 commit comments