-
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
1.x: observeOn - fix in-sequence termination/unsubscription #3768
1.x: observeOn - fix in-sequence termination/unsubscription #3768
Conversation
@@ -834,4 +834,16 @@ public void testErrorDelayedAsync() { | |||
ts.assertError(TestException.class); | |||
ts.assertNotCompleted(); | |||
} | |||
|
|||
@Test | |||
public void requestExactCompletesImmediately() { |
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.
Not sure if it tests "immediately", this test passes without changes in this PR.
Maybe you can avoid going to another thread and awaitTerminalEvent()
?
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.
Yeah, should request 0 upfront and wait till the range completes before requesting 10. I'll change this to use the TestScheduler.
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.
Updated the test which now clearly fails on master.
👍 for changes, not sure about test |
672fa8e
to
e98b20d
Compare
👍 |
1 similar comment
👍 |
…tionFix 1.x: observeOn - fix in-sequence termination/unsubscription
This fixes
observeOn
not completing immediately if the downstream requested exactly the remaining amount. The original version required a new request from downstream to trigger the delivery of the terminal event.This also fixes the rare failure in
testNoMoreRequestsAfterUnsubscribe
because the unsubscription is now checked in-sequence and doesn't trigger the unwanted replenishment request.