Skip to content

Commit f3acda7

Browse files
committed
Add filter of error messages in nginx logs to allow expected errors
1 parent 2194f9d commit f3acda7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/suite/graceful_recovery_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,15 @@ func checkContainerLogsForErrors(ngfPodName string) {
249249
&core.PodLogOptions{Container: nginxContainerName},
250250
)
251251
Expect(err).ToNot(HaveOccurred())
252-
Expect(logs).ToNot(ContainSubstring("[error]"), logs)
253-
Expect(logs).ToNot(ContainSubstring("[crit]"), logs)
254-
Expect(logs).ToNot(ContainSubstring("[alert]"), logs)
255-
Expect(logs).ToNot(ContainSubstring("[emerg]"), logs)
252+
253+
for _, line := range strings.Split(logs, "\n") {
254+
Expect(line).ToNot(ContainSubstring("[crit]"), line)
255+
Expect(line).ToNot(ContainSubstring("[alert]"), line)
256+
Expect(line).ToNot(ContainSubstring("[emerg]"), line)
257+
if strings.Contains(line, "[error]") {
258+
Expect(line).To(ContainSubstring("connect() failed (111: Connection refused)"), line)
259+
}
260+
}
256261

257262
logs, err = resourceManager.GetPodLogs(
258263
ngfNamespace,

0 commit comments

Comments
 (0)