@@ -90,7 +90,7 @@ func TestBatchSender_Merge(t *testing.T) {
90
90
assert .Equal (t , int64 (1 ), sink .RequestsCount ())
91
91
assert .Eventually (t , func () bool {
92
92
return sink .RequestsCount () == 2 && sink .ItemsCount () == 15
93
- }, 100 * time .Millisecond , 10 * time .Millisecond )
93
+ }, 1 * time .Second , 10 * time .Millisecond )
94
94
})
95
95
}
96
96
for _ , tt := range tests {
@@ -160,12 +160,12 @@ func TestBatchSender_BatchExportError(t *testing.T) {
160
160
errReq := & requesttest.FakeRequest {Items : 20 , ExportErr : errors .New ("transient error" ), Sink : sink }
161
161
require .NoError (t , be .Send (context .Background (), errReq ))
162
162
163
- // the batch should be dropped since the queue doesn't have requeuing enabled.
163
+ // the batch should be dropped since the queue doesn't have re-queuing enabled.
164
164
assert .Eventually (t , func () bool {
165
165
return sink .RequestsCount () == tt .expectedRequests &&
166
166
sink .ItemsCount () == tt .expectedItems &&
167
167
be .queue .Size () == 0
168
- }, 100 * time .Millisecond , 10 * time .Millisecond )
168
+ }, 1 * time .Second , 10 * time .Millisecond )
169
169
170
170
require .NoError (t , be .Shutdown (context .Background ()))
171
171
})
@@ -194,13 +194,13 @@ func TestBatchSender_MergeOrSplit(t *testing.T) {
194
194
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 8 , Sink : sink }))
195
195
assert .Eventually (t , func () bool {
196
196
return sink .RequestsCount () == 1 && sink .ItemsCount () == 8
197
- }, 500 * time .Millisecond , 10 * time .Millisecond )
197
+ }, 1 * time .Second , 10 * time .Millisecond )
198
198
199
199
// big request should be broken down into two requests, both are sent right away.
200
200
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 17 , Sink : sink }))
201
201
assert .Eventually (t , func () bool {
202
202
return sink .RequestsCount () == 3 && sink .ItemsCount () == 25
203
- }, 500 * time .Millisecond , 10 * time .Millisecond )
203
+ }, 1 * time .Second , 10 * time .Millisecond )
204
204
205
205
// request that cannot be split should be dropped.
206
206
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {
@@ -212,7 +212,7 @@ func TestBatchSender_MergeOrSplit(t *testing.T) {
212
212
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 13 , Sink : sink }))
213
213
assert .Eventually (t , func () bool {
214
214
return sink .RequestsCount () == 5 && sink .ItemsCount () == 38
215
- }, 500 * time .Millisecond , 10 * time .Millisecond )
215
+ }, 1 * time .Second , 10 * time .Millisecond )
216
216
require .NoError (t , be .Shutdown (context .Background ()))
217
217
})
218
218
}
@@ -370,20 +370,20 @@ func TestBatchSender_ConcurrencyLimitReached(t *testing.T) {
370
370
371
371
assert .Eventually (t , func () bool {
372
372
return sink .RequestsCount () == 1 && sink .ItemsCount () == 4
373
- }, 100 * time .Millisecond , 10 * time .Millisecond )
373
+ }, 1 * time .Second , 10 * time .Millisecond )
374
374
375
375
// the 3rd request should be flushed by itself due to flush interval
376
376
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 2 , Sink : sink }))
377
377
assert .Eventually (t , func () bool {
378
378
return sink .RequestsCount () == 2 && sink .ItemsCount () == 6
379
- }, 100 * time .Millisecond , 10 * time .Millisecond )
379
+ }, 1 * time .Second , 10 * time .Millisecond )
380
380
381
381
// the 4th and 5th request should be flushed in the same batched request by max concurrency limit.
382
382
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 2 , Sink : sink }))
383
383
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 2 , Sink : sink }))
384
384
assert .Eventually (t , func () bool {
385
385
return sink .RequestsCount () == 3 && sink .ItemsCount () == 10
386
- }, 100 * time .Millisecond , 10 * time .Millisecond )
386
+ }, 1 * time .Second , 10 * time .Millisecond )
387
387
388
388
// do it a few more times to ensure it produces the correct batch size regardless of goroutine scheduling.
389
389
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 5 , Sink : sink }))
@@ -392,15 +392,15 @@ func TestBatchSender_ConcurrencyLimitReached(t *testing.T) {
392
392
// in case of MaxSizeItems=10, wait for the leftover request to send
393
393
assert .Eventually (t , func () bool {
394
394
return sink .RequestsCount () == 5 && sink .ItemsCount () == 21
395
- }, 50 * time .Millisecond , 10 * time .Millisecond )
395
+ }, 1 * time .Second , 10 * time .Millisecond )
396
396
}
397
397
398
398
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 4 , Sink : sink }))
399
399
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 6 , Sink : sink }))
400
400
require .NoError (t , be .Send (context .Background (), & requesttest.FakeRequest {Items : 20 , Sink : sink }))
401
401
assert .Eventually (t , func () bool {
402
402
return sink .RequestsCount () == tt .expectedRequests && sink .ItemsCount () == tt .expectedItems
403
- }, 100 * time .Millisecond , 10 * time .Millisecond )
403
+ }, 1 * time .Second , 10 * time .Millisecond )
404
404
})
405
405
}
406
406
}
@@ -648,7 +648,7 @@ func TestBatchSenderTimerResetNoConflict(t *testing.T) {
648
648
assert .EventuallyWithT (t , func (c * assert.CollectT ) {
649
649
assert .LessOrEqual (c , int64 (1 ), sink .RequestsCount ())
650
650
assert .EqualValues (c , 8 , sink .ItemsCount ())
651
- }, 500 * time .Millisecond , 10 * time .Millisecond )
651
+ }, 1 * time .Second , 10 * time .Millisecond )
652
652
653
653
require .NoError (t , be .Shutdown (context .Background ()))
654
654
}
0 commit comments