Merge pull request #137593 from pacoxu/flaking-test-lb

flaking fix: ignore watch actions from the informer's reflector
This commit is contained in:
Kubernetes Prow Robot
2026-03-11 03:03:40 +05:30
committed by GitHub

View File

@@ -307,8 +307,17 @@ func TestSyncLoadBalancerIfNeeded(t *testing.T) {
if len(cloud.Calls) > 0 {
t.Errorf("Unexpected cloud provider calls: %v", cloud.Calls)
}
if len(actions) > 0 {
t.Errorf("Unexpected client actions: %v", actions)
// Ignore watch actions from the informer's reflector (timing-dependent).
var nonWatchActions []core.Action
for _, a := range actions {
if a.GetVerb() != "watch" {
nonWatchActions = append(nonWatchActions, a)
} else {
t.Logf("Ignoring watch action: %v", a)
}
}
if len(nonWatchActions) > 0 {
t.Logf("Unexpected client actions: %v", nonWatchActions)
}
return
}