@@ -189,17 +189,18 @@ var _ = Describe("CertWatcher", func() {
189
189
190
190
Expect (os .Remove (keyPath )).To (Succeed ())
191
191
192
+ // Note, we are checking two errors here, because os.Remove generates two fsnotify events: Chmod + Remove
192
193
Eventually (func () error {
193
194
readCertificateTotalAfter := testutil .ToFloat64 (metrics .ReadCertificateTotal )
194
- if readCertificateTotalAfter != readCertificateTotalBefore + 1 .0 {
195
- return fmt .Errorf ("metric read certificate total expected: %v and got: %v" , readCertificateTotalBefore + 1 .0 , readCertificateTotalAfter )
195
+ if readCertificateTotalAfter != readCertificateTotalBefore + 2 .0 {
196
+ return fmt .Errorf ("metric read certificate total expected: %v and got: %v" , readCertificateTotalBefore + 2 .0 , readCertificateTotalAfter )
196
197
}
197
198
return nil
198
199
}, "4s" ).Should (Succeed ())
199
200
Eventually (func () error {
200
201
readCertificateErrorsAfter := testutil .ToFloat64 (metrics .ReadCertificateErrors )
201
- if readCertificateErrorsAfter != readCertificateErrorsBefore + 1 .0 {
202
- return fmt .Errorf ("metric read certificate errors expected: %v and got: %v" , readCertificateErrorsBefore + 1 .0 , readCertificateErrorsAfter )
202
+ if readCertificateErrorsAfter != readCertificateErrorsBefore + 2 .0 {
203
+ return fmt .Errorf ("metric read certificate errors expected: %v and got: %v" , readCertificateErrorsBefore + 2 .0 , readCertificateErrorsAfter )
203
204
}
204
205
return nil
205
206
}, "4s" ).Should (Succeed ())
0 commit comments