Skip to content

Commit

Permalink
Merge pull request #2079 from sawsa307/fix-wait-poll-in-TestEnableDeg…
Browse files Browse the repository at this point in the history
…radedMode

Fix wait.PollImmediate in TestEnableDegradedMode
  • Loading branch information
k8s-ci-robot authored Apr 17, 2023
2 parents 90875c4 + 67d3f2d commit 73bd213
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/neg/syncers/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1830,16 +1830,19 @@ func TestEnableDegradedMode(t *testing.T) {
err = wait.PollImmediate(time.Second, 3*time.Second, func() (bool, error) {
out, _, err = retrieveExistingZoneNetworkEndpointMap(tc.negName, zoneGetter, fakeCloud, meta.VersionGA, negtypes.L7Mode)
if err != nil {
return false, err
return false, nil
}
if !reflect.DeepEqual(tc.expectedEndpoints, out) {
return false, err
return false, nil
}
s.syncLock.Lock()
errorState := s.inErrorState()
s.syncLock.Unlock()
if errorState != tc.expectedInErrorState {
return false, nil
}
return true, nil
})
if s.inErrorState() != tc.expectedInErrorState {
t.Errorf("after syncInternal, error state is %v, expected to be %v", s.inErrorState(), tc.expectedInErrorState)
}
if err != nil {
t.Errorf("endpoints are different from expected:\ngot %+v,\n expected %+v", out, tc.expectedEndpoints)
}
Expand Down

0 comments on commit 73bd213

Please sign in to comment.