3.x: Have all unit tests extend a base test class
By adding a common base class, we can enable a "global" timeout and a per-class log output that prevents Travis CI to stop the build and also not flood the log with all methods:
package io.reactivex.testsupport;
public abstract class RxJavaTest {
@Rule
protected Timeout globalTimeout = new Timeout(5, TimeUnit.MINUTES);
@Test
@Ignore
public final void announce() {
}
}
This way, we no longer have to rely on the random ignores scattered along the codebase. This baseclass-ignore may seem unnecessarily complicated, but unfortunately, I was unable to create a working setting via Gradle's test runner.
Hey, I see the interest having a global timeout in a base class. Please note that in Junit4, the timeout parameter on @Test annotation does not override the Timeout Rule. This can be an issue when a test requires a custom timeout.
Also, I don't understand the announce test. Do you expect every ignored test to be transferred in the class RxJavaTest?
No problem, default 2-5 minutes should work. Travis kills the build if no standard output is happening for 10 minutes. Announce should create a log print often. Ignore should be reevaluated in place and deleted if no longer needed.
Thanks, I'll submit a PR.
Hey, There are a few remaining things to close the issue. First, I did not delete ignored tests for the fusion operator. Second, I don't know what should be done to fix those non-deterministic and thread starvation tests:
- https://github.com/ReactiveX/RxJava/blob/3.x/src/test/java/io/reactivex/observers/SerializedObserverTest.java#L263
- https://github.com/ReactiveX/RxJava/blob/3.x/src/test/java/io/reactivex/observers/SerializedObserverTest.java#L353
- https://github.com/ReactiveX/RxJava/blob/3.x/src/test/java/io/reactivex/subscribers/SerializedSubscriberTest.java#L265
- https://github.com/ReactiveX/RxJava/blob/3.x/src/test/java/io/reactivex/subscribers/SerializedSubscriberTest.java#L355
Also, I did not update Technology Compatibility Kit (TCK) tests.
Don't worry about them. Thanks for your diligent work!