Mock queue backoff duration (#30553)

During testing, the backoff duration shouldn't be longer than other
durations
This commit is contained in:
wxiaoguang 2024-04-19 04:00:59 +08:00 committed by GitHub
parent dd8e6ae270
commit bcbeb24dba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -250,6 +250,7 @@ func TestWorkerPoolQueueShutdown(t *testing.T) {
func TestWorkerPoolQueueWorkerIdleReset(t *testing.T) {
defer test.MockVariableValue(&workerIdleDuration, 10*time.Millisecond)()
defer mockBackoffDuration(10 * time.Millisecond)()
handler := func(items ...int) (unhandled []int) {
time.Sleep(50 * time.Millisecond)