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 <shaquille@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
shaquilleq 2020-07-30 18:09:45 -07:00 коммит произвёл Shaquille Que
Родитель 8daf8c09a0
Коммит 94d940ab81
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -123,11 +123,11 @@ func TestServerHandler(t *testing.T) {
},
{
name: "rate limiter drops requests over cap",
serverConfig: Config{Rate: 25, Burst: 25},
serverConfig: Config{Rate: 5, Burst: 5},
handler: alwaysHandler{http.StatusOK},
steps: []interface{}{
request{25, http.StatusOK},
request{25, http.StatusTooManyRequests},
request{5, http.StatusOK},
request{6, http.StatusTooManyRequests},
},
},
{