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 <[email protected]>
Co-authored-by: Roman Zavodskikh <[email protected]>
  • Loading branch information
RomanZavodskikh and Roman Zavodskikh authored 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
Original file line number Diff line number Diff line change
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.