@Test
public void onSubscribeOnSubscribeRace() {

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