reactor / reactor-core

Non-Blocking Reactive Foundation for the JVM

Home Page:http://projectreactor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flaky test - DefaultTestSubscriberTest

chemicL opened this issue · comments


DefaultTestSubscriberTest > raceDetectionOnNextOnNext() FAILED
    java.lang.AssertionError: [asserts racy cases] 
    Expecting actual:
      100
    to be less than:
      100 
        at reactor.test.subscriber.DefaultTestSubscriberTest.raceDetectionOnNextOnNext(DefaultTestSubscriberTest.java:1128)

DefaultTestSubscriberTest > raceDetectionOnNextOnError() FAILED
    java.lang.AssertionError: [asserts racy cases] 
    Expecting actual:
      100
    to be less than:
      100 
        at reactor.test.subscriber.DefaultTestSubscriberTest.raceDetectionOnNextOnError(DefaultTestSubscriberTest.java:1210)

assertThat(interesting).as("asserts racy cases").isLessThan(RACE_DETECTION_LOOPS);

// TO-BE
assertThat(interesting).as("asserts racy cases").isLessThanOrEqualTo(RACE_DETECTION_LOOPS);

How about using .isLessThanOrEqualTo(RACE_DETECTION_LOOPS) instead of isLessThan,
or increase RACE_DETECTION_LOOPS to decrease probability of All loops trigger race condition?

Cause this test failed when interesting(race condition count) is same with RACE_DETECTION_LOOPS (= it means All loops trigger race condition, it's really rare case but can be happen 😅)

Hey, @injae-kim 👋
I agree with you. It is super interesting that all the cases are "interesting". But it's not a failure per-se. So please go ahead and perhaps increase the loops from 100 to 1000 are willing to contribute :) Otherwise let me know, I'll handle it.

Actually, this happens constantly now with the configuration I introduced. I'll try to submit a PR for it, hope you don't mind.

oh~ I checked your awesome fix #3766 👍
thank you for agreeing with my opinion :) I happy that my investigation make sense!

As I said, I just applied your suggestions @injae-kim, thanks again for your help!