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
319
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{}{}
320
+
require.Eventuallyf(t, func() bool {
321
+
for_, entry:=rangelogHook.AllEntries() {
322
+
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)) {
323
+
errLogs[entry.Time] =struct{}{}
324
+
}
312
325
}
313
-
}
314
-
315
-
require.Len(t, errLogs, 5)
326
+
returnlen(errLogs) ==5
327
+
}, 10*time.Second, 10*time.Millisecond, "Failed to assert error logs")
316
328
317
329
writeFile(t, keyFilePath, oidcServerKeyPem)
318
330
319
331
writeFile(t, certFilePath, oidcServerCertPem)
320
332
321
333
clk.Add(10*time.Millisecond)
322
334
323
-
require.Equal(t, "Loaded provided certificate with success", logHook.LastEntry().Message)
0 commit comments