Commit b60e775
committed
test/machinehealthcheck: fix flaky TestReconcile/machine_with_node_likely_to_go_unhealthy
The test set LastTransitionTime = time.Now() once at TestReconcile
init, then ran four other test cases before the timing-sensitive one.
If those cases took >2s total, durationUnhealthy exceeded the ±1s
tolerance window and the test failed intermittently.
Fix by resetting LastTransitionTime immediately before buildRunTimeObjects
is called for that specific test case, ensuring durationUnhealthy ≈ 0
at reconcile time.1 parent 4566a9a commit b60e775
1 file changed
Lines changed: 9 additions & 0 deletions
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
| |||
488 | 494 | | |
489 | 495 | | |
490 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
| |||
0 commit comments