зеркало из https://github.com/golang/pkgsite.git
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:
Родитель
8daf8c09a0
Коммит
94d940ab81
|
@ -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},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче