Skip to content

Commit 94d940a

Browse files
committed
internal/teeproxy: decrease rate limiter refilling rate in test
The test suite was flaking in CI due to the rate limiter having enough time to refill its bucket. Decrease the rate of refilling from 25 per second to 5 per second, which increases the time taken to permit an additional request from 40ms to 200ms. Change-Id: I29fb9c692648f4462d190c9f63a7066e335ae957 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/246037 Run-TryBot: Shaquille Que <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
1 parent 8daf8c0 commit 94d940a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/teeproxy/teeproxy_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ func TestServerHandler(t *testing.T) {
123123
},
124124
{
125125
name: "rate limiter drops requests over cap",
126-
serverConfig: Config{Rate: 25, Burst: 25},
126+
serverConfig: Config{Rate: 5, Burst: 5},
127127
handler: alwaysHandler{http.StatusOK},
128128
steps: []interface{}{
129-
request{25, http.StatusOK},
130-
request{25, http.StatusTooManyRequests},
129+
request{5, http.StatusOK},
130+
request{6, http.StatusTooManyRequests},
131131
},
132132
},
133133
{

0 commit comments

Comments
 (0)