Switch the client event recorder from exponential backoff to one random

sleep on the first failed request followed by a constant amount on all
subsequent consecutive failed requests.
This commit is contained in:
Alex Robinson
2015-01-13 19:13:24 +00:00
parent be6b1cf0e2
commit 3eaf362f8e
2 changed files with 13 additions and 16 deletions

View File

@@ -22,7 +22,6 @@ import (
"strconv"
"strings"
"testing"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
@@ -33,8 +32,7 @@ import (
func init() {
// Don't bother sleeping between retries.
minSleep = 0
maxSleep = 0
sleepDuration = 0
}
type testEventRecorder struct {
@@ -195,12 +193,12 @@ func TestWriteEventError(t *testing.T) {
},
"retry1": {
timesToSendError: 1000,
attemptsWanted: 10,
attemptsWanted: 12,
err: &errors.UnexpectedObjectError{},
},
"retry2": {
timesToSendError: 1000,
attemptsWanted: 10,
attemptsWanted: 12,
err: fmt.Errorf("A weird error"),
},
"succeedEventually": {