You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require.Equalf(t, http.StatusServiceUnavailable, resp.StatusCode, "Was expecting status code 503 from health check, but got %d instead", resp.StatusCode)
66
+
assert.NotEmpty(t, hook.Entries, "Was expecting at least one log entry from health check, but got none")
67
+
expectedMsg:="Error serving health check request"
68
+
varfoundEntry log.Entry
69
+
for_, entry:=rangehook.Entries {
70
+
ifentry.Level==log.ErrorLevel&&
71
+
entry.Message==expectedMsg {
72
+
foundEntry=entry
73
+
break
74
+
}
75
+
}
76
+
require.NotEmpty(t, foundEntry, "Expected an error message '%s', but it was't found", expectedMsg)
77
+
actualErr, ok:=foundEntry.Data["error"].(error)
78
+
require.True(t, ok, "Expected 'error' field to contain an error, but it doesn't")
79
+
assert.Equal(t, svcErrMsg, actualErr.Error(), "expected original error message '"+svcErrMsg+"', but got '"+actualErr.Error()+"'")
0 commit comments