Merge pull request #62914 from sjenning/kubelet-unit-flake

Automatic merge from submit-queue (batch tested with PRs 62914, 63431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: fix flake in TestUpdateExistingNodeStatusTimeout

xref https://github.com/openshift/origin/issues/19443

There are cases where some process, outside the test, attempts to connect to the port we are using to do the test, leading to a attempt count greater than what we expect.

To deal with this, just ensure that we have seen *at least* the number of connection attempts we expect.

@liggitt 

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-07 10:44:05 -07:00 committed by GitHub
commit bc1c2de163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -642,8 +642,8 @@ func TestUpdateExistingNodeStatusTimeout(t *testing.T) {
assert.Error(t, kubelet.updateNodeStatus())
// should have attempted multiple times
if actualAttempts := atomic.LoadInt64(&attempts); actualAttempts != nodeStatusUpdateRetry {
t.Errorf("Expected %d attempts, got %d", nodeStatusUpdateRetry, actualAttempts)
if actualAttempts := atomic.LoadInt64(&attempts); actualAttempts < nodeStatusUpdateRetry {
t.Errorf("Expected at least %d attempts, got %d", nodeStatusUpdateRetry, actualAttempts)
}
}