Skip to content

Commit

Permalink
WIP > Fix test naming mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Oct 4, 2019
1 parent 803eeca commit 2503593
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions estransport/estransport_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,21 @@ func TestTransportPerformRetries(t *testing.T) {
i++
fmt.Printf("Request #%d", i)
fmt.Print(": ERR\n")
return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)}
return nil, fmt.Errorf("Mock regular error (%d)", i)
},
},
DisableRetry: true,
})
}})

req, _ := http.NewRequest("GET", "/abc", nil)
tp.Perform(req)

res, err := tp.Perform(req)

if err == nil {
t.Fatalf("Expected error, got: %v", err)
}

if res != nil {
t.Errorf("Unexpected response: %+v", res)
}

if i != 1 {
t.Errorf("Unexpected number of requests, want=%d, got=%d", 1, i)
Expand All @@ -375,21 +382,14 @@ func TestTransportPerformRetries(t *testing.T) {
i++
fmt.Printf("Request #%d", i)
fmt.Print(": ERR\n")
return nil, fmt.Errorf("Mock regular error (%d)", i)
return nil, &mockNetError{error: fmt.Errorf("Mock network error (%d)", i)}
},
}})
},
DisableRetry: true,
})

req, _ := http.NewRequest("GET", "/abc", nil)

res, err := tp.Perform(req)

if err == nil {
t.Fatalf("Expected error, got: %v", err)
}

if res != nil {
t.Errorf("Unexpected response: %+v", res)
}
tp.Perform(req)

if i != 1 {
t.Errorf("Unexpected number of requests, want=%d, got=%d", 1, i)
Expand Down

0 comments on commit 2503593

Please sign in to comment.