Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for SerializedObserverTest #1128

Merged

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.

None yet

3 participants