Skip to content

Commit e4d6058

Browse files
authored
fix: application 404 expectations (#930)
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.
1 parent a9f421a commit e4d6058

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/readiness_healthcheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var _ = AppsDescribe("Readiness Healthcheck", func() {
6969
By("verifying the app is removed from the routing table")
7070
Eventually(func() string {
7171
return helpers.CurlApp(Config, appName, "/ready")
72-
}, readinessHealthCheckTimeout).Should(ContainSubstring("404 Not Found"))
72+
}, readinessHealthCheckTimeout).Should(ContainSubstring("404"))
7373

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

apps/rolling_deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var _ = AppsDescribe("Rolling deploys", func() {
5858
return
5959
case <-tickerChannel:
6060
appResponse := helpers.CurlAppRoot(Config, appName)
61-
Expect(appResponse).ToNot(ContainSubstring("404 Not Found"))
61+
Expect(appResponse).ToNot(ContainSubstring("404"))
6262
Expect(appResponse).To(ContainSubstring("Hi, I'm Dora!"))
6363
}
6464
}

v3/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func checkAppRemainsAlive(appName string) (chan<- bool, <-chan bool) {
208208
appCheckerIsDone <- true
209209
return
210210
case <-tickerChannel:
211-
Expect(helpers.CurlAppRoot(Config, appName)).ToNot(ContainSubstring("404 Not Found"))
211+
Expect(helpers.CurlAppRoot(Config, appName)).ToNot(ContainSubstring("404"))
212212
}
213213
}
214214
}()

windows/readiness_healthcheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var _ = WindowsDescribe("Readiness Healthcheck", func() {
7070
By("verifying the app is removed from the routing table")
7171
Eventually(func() string {
7272
return helpers.CurlApp(Config, appName, "/ready")
73-
}, readinessHealthCheckTimeout).Should(ContainSubstring("404 Not Found"))
73+
}, readinessHealthCheckTimeout).Should(ContainSubstring("404"))
7474

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

0 commit comments

Comments
 (0)