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
// Assert error logs that will keep triggering until the cert is created again.
308
308
errLogs=map[time.Time]struct{}{}
309
-
for_, entry:=rangelogHook.AllEntries() {
310
-
ifentry.Level==logrus.ErrorLevel&&strings.Contains(entry.Message, fmt.Sprintf("Failed to get file info, file path %q does not exist anymore; please check if the path is correct", certFilePath)) {
311
-
errLogs[entry.Time] =struct{}{}
309
+
require.Eventuallyf(t, func() bool {
310
+
for_, entry:=rangelogHook.AllEntries() {
311
+
ifentry.Level==logrus.ErrorLevel&&strings.Contains(entry.Message, fmt.Sprintf("Failed to get file info, file path %q does not exist anymore; please check if the path is correct", certFilePath)) {
312
+
errLogs[entry.Time] =struct{}{}
313
+
}
312
314
}
313
-
}
314
-
315
-
require.Len(t, errLogs, 5)
315
+
returnlen(errLogs) ==5
316
+
}, 10*time.Second, 10*time.Millisecond, "Failed to assert error logs")
316
317
317
318
writeFile(t, keyFilePath, oidcServerKeyPem)
318
319
319
320
writeFile(t, certFilePath, oidcServerCertPem)
320
321
321
322
clk.Add(10*time.Millisecond)
322
323
323
-
require.Equal(t, "Loaded provided certificate with success", logHook.LastEntry().Message)
0 commit comments