File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2228,14 +2228,18 @@ func TestRequestPreflightCheck(t *testing.T) {
22282228
22292229func TestThrottledLogger (t * testing.T ) {
22302230 now := time .Now ()
2231+ oldClock := globalThrottledLogger .clock
2232+ defer func () {
2233+ globalThrottledLogger .clock = oldClock
2234+ }()
22312235 clock := clock .NewFakeClock (now )
22322236 globalThrottledLogger .clock = clock
22332237
22342238 logMessages := 0
2235- for i := 0 ; i < 10000 ; i ++ {
2239+ for i := 0 ; i < 1000 ; i ++ {
22362240 var wg sync.WaitGroup
2237- wg .Add (100 )
2238- for j := 0 ; j < 100 ; j ++ {
2241+ wg .Add (10 )
2242+ for j := 0 ; j < 10 ; j ++ {
22392243 go func () {
22402244 if _ , ok := globalThrottledLogger .attemptToLog (); ok {
22412245 logMessages ++
@@ -2248,7 +2252,7 @@ func TestThrottledLogger(t *testing.T) {
22482252 clock .SetTime (now )
22492253 }
22502254
2251- if a , e := logMessages , 1000 ; a != e {
2255+ if a , e := logMessages , 100 ; a != e {
22522256 t .Fatalf ("expected %v log messages, but got %v" , e , a )
22532257 }
22542258}
You can’t perform that action at this time.
0 commit comments