The bulk of #1006 sprawled because reproducing failure modes needed integration shells with time.Sleep for healthcheck convergence -- 800ms-1.5s waits in integration/alb_matrix_test.go:249-253, integration/alb_chaos_test.go:88, pkg/backends/healthcheck/healthcheck_reregister_test.go:129, plus six polling loops in pkg/backends/alb/pool/pool_stale_cache_repro_test.go. There's no Clock abstraction in the tree (~58 files call time.Now() directly) and zero testing/synctest usage despite Go 1.26 in go.mod, so anything depending on probe interval / failure-threshold timing has to be exercised by wall-clock waits.
Scoped proposal:
- add
pkg/util/clock (small interface, default real-clock singleton)
- thread it through
pkg/backends/healthcheck/target.go and pkg/backends/alb/pool/health.go
- convert those two packages' tests to
synctest.Run
That should delete the polling loops in pool_stale_cache_repro_test.go and let the integration suite shed its healthcheck-converge sleeps.
Recommend looking attesting/synctest first, then k8s.io/utils/clock as fallback for paths a synctest bubble can't cover.
Related: #807 (proxy refactor umbrella), #1006 (motivating PR).
The bulk of #1006 sprawled because reproducing failure modes needed integration shells with
time.Sleepfor healthcheck convergence -- 800ms-1.5s waits inintegration/alb_matrix_test.go:249-253,integration/alb_chaos_test.go:88,pkg/backends/healthcheck/healthcheck_reregister_test.go:129, plus six polling loops inpkg/backends/alb/pool/pool_stale_cache_repro_test.go. There's noClockabstraction in the tree (~58 files calltime.Now()directly) and zerotesting/synctestusage despite Go 1.26 ingo.mod, so anything depending on probe interval / failure-threshold timing has to be exercised by wall-clock waits.Scoped proposal:
pkg/util/clock(small interface, default real-clock singleton)pkg/backends/healthcheck/target.goandpkg/backends/alb/pool/health.gosynctest.RunThat should delete the polling loops in
pool_stale_cache_repro_test.goand let the integration suite shed its healthcheck-converge sleeps.Recommend looking at
testing/synctestfirst, thenk8s.io/utils/clockas fallback for paths a synctest bubble can't cover.Related: #807 (proxy refactor umbrella), #1006 (motivating PR).