Skip to content

Commit d0229de

Browse files
committed
TEST/MINOR: Prevent nil pointer dereference.
Avoid closing a failed connection in e2e test canary-deployment.
1 parent 4bb3943 commit d0229de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

deploy/tests/e2e/canary-deployment/percentage_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ func (suite *CanaryDeploymentSuite) Test_Response_Percentage() {
3333
counter := 0
3434
for i := 0; i < 10; i++ {
3535
res, cls, err := suite.client.Do()
36-
suite.NoError(err)
36+
if res == nil {
37+
suite.T().Log(err)
38+
continue
39+
}
3740
defer cls()
3841
if res.StatusCode == 200 {
3942
body, _ := ioutil.ReadAll(res.Body)

0 commit comments

Comments
 (0)