Skip to content

Commit

Permalink
fix: application 404 expectations (#930)
Browse files Browse the repository at this point in the history
In case operators are overriding their router's error pages, we should
not check for a specific string. However, the presence of "404" on a 404
error page is probably a safe assumption to make.
  • Loading branch information
ctlong authored Oct 13, 2023
1 parent a9f421a commit e4d6058
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/readiness_healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var _ = AppsDescribe("Readiness Healthcheck", func() {
By("verifying the app is removed from the routing table")
Eventually(func() string {
return helpers.CurlApp(Config, appName, "/ready")
}, readinessHealthCheckTimeout).Should(ContainSubstring("404 Not Found"))
}, readinessHealthCheckTimeout).Should(ContainSubstring("404"))

By("verifying that the app hasn't restarted")
Consistently(cf.Cf("events", appName)).ShouldNot(Say("audit.app.process.crash"))
Expand Down
2 changes: 1 addition & 1 deletion apps/rolling_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var _ = AppsDescribe("Rolling deploys", func() {
return
case <-tickerChannel:
appResponse := helpers.CurlAppRoot(Config, appName)
Expect(appResponse).ToNot(ContainSubstring("404 Not Found"))
Expect(appResponse).ToNot(ContainSubstring("404"))
Expect(appResponse).To(ContainSubstring("Hi, I'm Dora!"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion v3/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func checkAppRemainsAlive(appName string) (chan<- bool, <-chan bool) {
appCheckerIsDone <- true
return
case <-tickerChannel:
Expect(helpers.CurlAppRoot(Config, appName)).ToNot(ContainSubstring("404 Not Found"))
Expect(helpers.CurlAppRoot(Config, appName)).ToNot(ContainSubstring("404"))
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion windows/readiness_healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var _ = WindowsDescribe("Readiness Healthcheck", func() {
By("verifying the app is removed from the routing table")
Eventually(func() string {
return helpers.CurlApp(Config, appName, "/ready")
}, readinessHealthCheckTimeout).Should(ContainSubstring("404 Not Found"))
}, readinessHealthCheckTimeout).Should(ContainSubstring("404"))

By("verifying that the app hasn't restarted")
Consistently(cf.Cf("events", appName)).ShouldNot(Say("audit.app.process.crash"))
Expand Down

0 comments on commit e4d6058

Please sign in to comment.