Skip to content

Commit

Permalink
Rebase with fixes to skipped failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bjee19 committed Jun 24, 2024
1 parent 0da0582 commit ebc4b04
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/suite/graceful_recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ var _ = Describe("Graceful Recovery test", Ordered, Label("functional", "gracefu
})

It("recovers when node is restarted abruptly", func() {
// FIXME(bjee19) remove Skip() when https://github.com/nginxinc/nginx-gateway-fabric/issues/1108 is completed.
Skip("Test currently fails due to this issue: https://github.com/nginxinc/nginx-gateway-fabric/issues/1108")
runRestartNodeAbruptlyTest(teaURL, coffeeURL, files, &ns)
})
})
Expand Down Expand Up @@ -178,14 +176,16 @@ func runRestartNodeTest(teaURL, coffeeURL string, files []string, ns *core.Names
ngfPodName := podNames[0]
Expect(ngfPodName).ToNot(Equal(""))

time.Sleep(20 * time.Second)

if portFwdPort != 0 {
ports := []string{fmt.Sprintf("%d:80", ngfHTTPForwardedPort), fmt.Sprintf("%d:443", ngfHTTPSForwardedPort)}
portForwardStopCh = make(chan struct{})
err = framework.PortForward(ctlr.GetConfigOrDie(), ngfNamespace, ngfPodName, ports, portForwardStopCh)
Expect(err).ToNot(HaveOccurred())
}

checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, files, ns)
checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, "", files, ns)
}

func runRecoveryTest(teaURL, coffeeURL, ngfPodName, containerName string, files []string, ns *core.Namespace) {
Expand Down Expand Up @@ -215,7 +215,7 @@ func runRecoveryTest(teaURL, coffeeURL, ngfPodName, containerName string, files
Should(Succeed())
}

checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, files, ns)
checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, containerName, files, ns)
}

func restartContainer(ngfPodName, containerName string) {
Expand Down Expand Up @@ -313,12 +313,12 @@ func expectRequestToFail(appURL, address string) error {
return nil
}

func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName string, files []string, ns *core.Namespace) {
func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, containerName string, files []string, ns *core.Namespace) {
Eventually(
func() error {
return checkForWorkingTraffic(teaURL, coffeeURL)
}).
WithTimeout(timeoutConfig.RequestTimeout).
WithTimeout(timeoutConfig.RequestTimeout * 2).
WithPolling(500 * time.Millisecond).
Should(Succeed())

Expand All @@ -339,11 +339,11 @@ func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName string, files []string,
func() error {
return checkForWorkingTraffic(teaURL, coffeeURL)
}).
WithTimeout(timeoutConfig.RequestTimeout).
WithTimeout(timeoutConfig.RequestTimeout * 2).
WithPolling(500 * time.Millisecond).
Should(Succeed())

checkContainerLogsForErrors(ngfPodName, true)
checkContainerLogsForErrors(ngfPodName, containerName == nginxContainerName)
}

// checkContainerLogsForErrors checks both nginx and ngf container's logs for any possible errors.
Expand Down

0 comments on commit ebc4b04

Please sign in to comment.