kubernetes/pkg/controller/nodeipam/ipam/sync
Davanum Srinivas 5d3e8d9db6
nodeipam: buffer TestNodeSyncResync report notifications
TestNodeSyncResync closes opChan after observing the first resync and then
waits for the loop to exit. There is still a small window where the 1ms
resync timer fires again before the select notices the closed channel.
When that happens ReportResult sends a second notification on the
unbuffered reportChan, the loop blocks in the send, and the test waits
forever on doneChan.

Allow one queued notification so the loop can drain that race and reach
the closed opChan case. The test still validates that a resync happened;
it just stops depending on exact scheduling between two ready events.

Tested:
go test -race ./pkg/controller/nodeipam/ipam/sync -run TestNodeSyncResync -count=200
2026-03-14 11:58:31 -04:00
..
sync.go use klog.InfoS instead of klog.V(0),Info 2023-03-07 15:50:01 +08:00
sync_test.go nodeipam: buffer TestNodeSyncResync report notifications 2026-03-14 11:58:31 -04:00