-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
2.x: Fix Completable.andThen(Completable) not running on observeOn scheduler. #6362
Conversation
…fined with observeOn.
…fined with observeOn.
@Test | ||
public void andThenCompletableCompleteError() { | ||
Completable.complete() | ||
.andThen(Completable.error(new RuntimeException("test"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use TestException
so we don't mistake them with any other RuntimeException
failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done.
@@ -69,39 +63,4 @@ public void andThenMaybeError() { | |||
.assertError(RuntimeException.class) | |||
.assertErrorMessage("bla"); | |||
} | |||
|
|||
@Test | |||
public void andThenNoInterrupt() throws InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this test removed without explanation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it to CompletableAndThenCompletableTest since it specifically tested .andThen(Completable)
.
Codecov Report
@@ Coverage Diff @@
## 2.x #6362 +/- ##
============================================
- Coverage 98.28% 98.25% -0.04%
- Complexity 6285 6286 +1
============================================
Files 672 673 +1
Lines 44990 45021 +31
Branches 6223 6224 +1
============================================
+ Hits 44219 44234 +15
- Misses 243 250 +7
- Partials 528 537 +9
Continue to review full report at Codecov.
|
…fined with observeOn.
This PR fixes unpredictable scheduler/thread used by
Completable.observeOn(...)andThen(Completable)
, since sometimes scheduler defined in observeOn(...) was not used. It was inconsistent with similar.andThen(Maybe)
and.andThen(Single)
, since those are guaranteed to run second Completable using proper scheduler if defined with.observeOn
.Fixes: #6354.