-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
when millisecond resolution is used, everything works correctly. but the same test fails when all units are changed to nanosecond. the following test fails but should pass
import org.junit.Test;
import rx.Observable;
import rx.observers.TestSubscriber;
import rx.schedulers.TestScheduler;
import java.util.concurrent.TimeUnit;
public class NanosecondTest {
@Test
public void shoud_schedule_correctly_with_nanosecond_resolution() {
TestScheduler scheduler = new TestScheduler();
TestSubscriber<Long> testSubscriber = new TestSubscriber<>();
TimeUnit unit = TimeUnit.NANOSECONDS; // change to TimeUnit.MILLISECONDS and test will pass
Observable.interval(30, unit, scheduler).subscribe(testSubscriber);
scheduler.advanceTimeTo(60, unit);
testSubscriber.assertValues(0L, 1L);
}
}
compile 'io.reactivex:rxjava:1.2.2'
Reactions are currently unavailable