refactor: some minor changes.
This commit is contained in:
parent
529e34d2ae
commit
b9d8eff994
9 changed files with 24 additions and 76 deletions
|
@ -19,7 +19,7 @@ func TestMetricsRetryListener(t *testing.T) {
|
|||
|
||||
wantCounterValue := float64(2)
|
||||
if retryMetrics.retriesCounter.CounterValue != wantCounterValue {
|
||||
t.Errorf("got counter value of %d, want %d", retryMetrics.retriesCounter.CounterValue, wantCounterValue)
|
||||
t.Errorf("got counter value of %f, want %f", retryMetrics.retriesCounter.CounterValue, wantCounterValue)
|
||||
}
|
||||
|
||||
wantLabelValues := []string{"backend", "backendName"}
|
||||
|
|
|
@ -174,7 +174,7 @@ func TestNewRegexHandler(t *testing.T) {
|
|||
assert.Equal(t, test.expectedStatus, recorder.Code)
|
||||
|
||||
location, err := recorder.Result().Location()
|
||||
require.Error(t, err, "ghf %v", location)
|
||||
require.Errorf(t, err, "Location %v", location)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -125,7 +125,7 @@ type retryResponseWriterWithoutCloseNotify struct {
|
|||
}
|
||||
|
||||
func (rr *retryResponseWriterWithoutCloseNotify) ShouldRetry() bool {
|
||||
return *rr.netErrorOccured == true && !rr.attemptsExhausted
|
||||
return *rr.netErrorOccured && !rr.attemptsExhausted
|
||||
}
|
||||
|
||||
func (rr *retryResponseWriterWithoutCloseNotify) Header() http.Header {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue