@Test
public void onCompleteOnCompleteRace() {

    for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
        final FlowableProcessor<Integer> s = PublishProcessor.<Integer>create().toSerialized();
        TestSubscriber<Integer> ts = s.test();
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                s.onComplete();
            }
        };
        Runnable r2 = new Runnable() {
            @Override
            public void run() {
                s.onComplete();
            }
        };
        TestHelper.race(r1, r2);
        ts.assertResult();
    }
}