Skip to content

Commit

Permalink
Retry ping
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Nov 23, 2023
1 parent b7c0d25 commit e63c26c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion testing/cloude2e/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ func (suite *TestSuite) TestFleetServerStatusOK() {
req, err := http.NewRequestWithContext(ctx, "GET", suite.fleetServerURL+"/api/status", nil)
suite.Require().NoError(err)

resp, err := suite.client.Do(req)
var resp *http.Response
for ctx.Err() == nil {
resp, err = suite.client.Do(req)
if resp != nil && resp.StatusCode == http.StatusOK {
break
}
time.Sleep(time.Second)
}
suite.Require().NoError(err)
suite.Require().Equal(http.StatusOK, resp.StatusCode)

Expand Down

0 comments on commit e63c26c

Please sign in to comment.