Skip to content

Fix for SerializedObserverTest#1128

Merged
benjchristensen merged 1 commit intoReactiveX:masterfrom
akarnokd:SerializedObserverTestFix
Apr 30, 2014
Merged

Fix for SerializedObserverTest#1128
benjchristensen merged 1 commit intoReactiveX:masterfrom
akarnokd:SerializedObserverTestFix

Conversation

@akarnokd
Copy link
Member

Fixed the SerializedObserverTest's problematic assertions:

  • testMultiThreadedWithNPEinMiddle might schedule all non-null values before the exception might reach the serialized observer. In addition, waiting after the serialization doesn't help because the cheap value emissions get queued up before that, again, possibly before the exception. The new code adds some delays to the non-null elements allowing the exception to get into the queue. I've looped it 10.000 times without failure, but there is still a non-zero chance the new NullPointerException() thread is significantly delayed and ends up as the last event.
  • testNotificationDelay might fail due to thread scheduling of the two OnNextThread delayed too much in respect to each other before the main thread allows the pass-through. The fix is to let bot instances' Thread reach the run method and then let the main thread pass through them. Again, a loop of 10.000 succeeded locally.
  • Both tests are run 10 times to be more sure.

@cloudbees-pull-request-builder

RxJava-pull-requests #1041 SUCCESS
This pull request looks good

@benjchristensen benjchristensen merged commit b16727c into ReactiveX:master Apr 30, 2014
@akarnokd akarnokd deleted the SerializedObserverTestFix branch April 30, 2014 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants