File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -443,7 +443,13 @@ public void testFirehoseFailsAsExpected() {
443
443
444
444
@ Test (timeout = 10000 )
445
445
public void testOnBackpressureDrop () {
446
+ long t = System .currentTimeMillis ();
446
447
for (int i = 0 ; i < 100 ; i ++) {
448
+ // stop the test if we are getting close to the timeout because slow machines
449
+ // may not get through 100 iterations
450
+ if (System .currentTimeMillis () - t > TimeUnit .SECONDS .toMillis (9 )) {
451
+ break ;
452
+ }
447
453
int NUM = (int ) (RxRingBuffer .SIZE * 1.1 ); // > 1 so that take doesn't prevent buffer overflow
448
454
AtomicInteger c = new AtomicInteger ();
449
455
TestSubscriber <Integer > ts = new TestSubscriber <Integer >();
Original file line number Diff line number Diff line change @@ -224,7 +224,11 @@ public void testSimpleOneLessAsyncLoop() {
224
224
}
225
225
@ Test (timeout = 10000 )
226
226
public void testSimpleOneLessAsync () {
227
+ long t = System .currentTimeMillis ();
227
228
for (int i = 2 ; i < 50 ; i ++) {
229
+ if (System .currentTimeMillis () - t > TimeUnit .SECONDS .toMillis (9 )) {
230
+ break ;
231
+ }
228
232
TestSubscriber <Integer > ts = new TestSubscriber <Integer >();
229
233
List <Observable <Integer >> sourceList = new ArrayList <Observable <Integer >>(i );
230
234
Set <Integer > expected = new HashSet <Integer >(i );
You can’t perform that action at this time.
0 commit comments