Skip to content

Commit

Permalink
Removed rtFailureProbability variable (#3038)
Browse files Browse the repository at this point in the history
This variable is actually is not being used during sending requests
to the test proxy, but left in the assert statement.
The test were working before, because the result of multiplication
is close enough to zero.

Signed-off-by: Roman Zavodskikh <roman.zavodskikh@zalando.de>
Co-authored-by: Roman Zavodskikh <roman.zavodskikh@zalando.de>
  • Loading branch information
RomanZavodskikh and Roman Zavodskikh committed Apr 23, 2024
1 parent 4db806b commit b5b0a32
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions proxy/healthy_endpoints_test.go
Expand Up @@ -13,9 +13,8 @@ import (
)

const (
nRequests = 15_000
rtFailureProbability = 0.8
period = 100 * time.Millisecond
nRequests = 15_000
period = 100 * time.Millisecond
)

func defaultEndpointRegistry() *routing.EndpointRegistry {
Expand Down Expand Up @@ -178,7 +177,7 @@ func TestPHCForMultipleHealthyAndOneUnhealthyEndpoints(t *testing.T) {
defer tp.close()
defer ps.Close()
failedReqs := sendGetRequests(t, ps)
assert.InDelta(t, 0.33*rtFailureProbability*(1.0-rtFailureProbability)*float64(nRequests), failedReqs, 0.1*float64(nRequests))
assert.InDelta(t, 0, failedReqs, 0.1*float64(nRequests))
})
}

Expand All @@ -188,6 +187,6 @@ func TestPHCForMultipleHealthyAndOneUnhealthyEndpoints(t *testing.T) {
defer tp.close()
defer ps.Close()
failedReqs := sendGetRequests(t, ps)
assert.InDelta(t, 0.33*rtFailureProbability*(1.0-rtFailureProbability)*float64(nRequests), failedReqs, 0.1*float64(nRequests))
assert.InDelta(t, 0, failedReqs, 0.1*float64(nRequests))
})
}

0 comments on commit b5b0a32

Please sign in to comment.