Skip to content

Commit

Permalink
Flaky: TestAllocator (#839)
Browse files Browse the repository at this point in the history
Move creatRestClient into the polling code, as its possible the
e2e test could use the old secret, if called early enough in the flow.
  • Loading branch information
markmandel committed Jun 18, 2019
1 parent 672a1f3 commit 8ee5791
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/e2e/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ func TestAllocator(t *testing.T) {
return
}

client, err := creatRestClient("agones-system", "allocator-tls")
if !assert.Nil(t, err) {
return
}

// wait for the allocation system to come online
var response *http.Response
err = wait.PollImmediate(2*time.Second, 5*time.Minute, func() (bool, error) {
// create the rest client each time, as we may end up looking at an old cert
var client *http.Client
client, err = creatRestClient("agones-system", "allocator-tls")
if err != nil {
return true, err
}

response, err = client.Post(requestURL, "application/json", bytes.NewBuffer(body))
if err != nil {
logrus.WithError(err).Infof("failing http request")
Expand Down

0 comments on commit 8ee5791

Please sign in to comment.