mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Merge pull request #137593 from pacoxu/flaking-test-lb
flaking fix: ignore watch actions from the informer's reflector
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user