Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break tests as approach timeout so that don't fail on slow machines #3085

Merged
merged 1 commit into from
Jul 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/test/java/rx/BackpressureTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,13 @@ public void testFirehoseFailsAsExpected() {

@Test(timeout = 10000)
public void testOnBackpressureDrop() {
long t = System.currentTimeMillis();
for (int i = 0; i < 100; i++) {
// stop the test if we are getting close to the timeout because slow machines
// may not get through 100 iterations
if (System.currentTimeMillis() - t > TimeUnit.SECONDS.toMillis(9)) {
break;
}
int NUM = (int) (RxRingBuffer.SIZE * 1.1); // > 1 so that take doesn't prevent buffer overflow
AtomicInteger c = new AtomicInteger();
TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ public void testSimpleOneLessAsyncLoop() {
}
@Test(timeout = 10000)
public void testSimpleOneLessAsync() {
long t = System.currentTimeMillis();
for (int i = 2; i < 50; i++) {
if (System.currentTimeMillis() - t > TimeUnit.SECONDS.toMillis(9)) {
break;
}
TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
List<Observable<Integer>> sourceList = new ArrayList<Observable<Integer>>(i);
Set<Integer> expected = new HashSet<Integer>(i);
Expand Down