cert-manager/pkg/scheduler
Ashley Davis 89bb5481cb
Increase margin of error in an otherwise unsound test
This test can easily fail on a heavily loaded machine, such as one
running many tests in parallel.

1. The afterFunc could be delayed _massively_ on a heavily loaded
   machine, such as one running a lot of tests in parallel.
2. Requiring an accuracy of 1ms seems like a flake waiting to happen
   (as it was in this case)
3. When we write code which uses this scheduler, we can't even
   safely assume the afterFunc will _ever_ be run, let alone run
   within a 1% margin of time error. As such I don't think this
   test is providing any value beyond a general sanity check.

By increasing the allowable delta massively, we keep this test as a
sanity check but basically remove the chance of a flake. The test
essentially becomes "does afterFunc work, generally?".

Also adds a check that the elapsed time is greater than the expected
time.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-11 10:14:34 +00:00
..
test rename all uses of github.com/jetstack/cert-manager 2022-02-02 09:08:31 +00:00
BUILD.bazel rename all uses of github.com/jetstack/cert-manager 2022-02-02 09:08:31 +00:00
scheduler_test.go Increase margin of error in an otherwise unsound test 2022-02-11 10:14:34 +00:00
scheduler.go Revert "memory leak: clean up scheduler goroutine on cert deletion" 2021-07-28 19:19:39 +02:00