diff --git a/retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/CancelDisposeTest.java b/retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/CancelDisposeTest.java index e91b656798..d6cd4eda92 100644 --- a/retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/CancelDisposeTest.java +++ b/retrofit-adapters/rxjava/src/test/java/retrofit2/adapter/rxjava/CancelDisposeTest.java @@ -63,12 +63,12 @@ public void disposeCancelsCall() { assertTrue(calls.get(0).isCanceled()); } - @Test + @Test(timeout=500) public void cancelDoesNotDispose() { Subscription subscription = service.go().subscribe(); List calls = client.dispatcher().runningCalls(); assertEquals(1, calls.size()); calls.get(0).cancel(); - assertFalse(subscription.isUnsubscribed()); + while (!subscription.isUnsubscribed()) { } } }