-
Notifications
You must be signed in to change notification settings - Fork 128
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 concat map request race condition which resulted in flaky test #1341
Conversation
Change how the upstream request is deferred until the next downstream request
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1341 +/- ##
============================================
+ Coverage 89.64% 89.95% +0.30%
- Complexity 3349 3361 +12
============================================
Files 459 459
Lines 13327 13325 -2
Branches 1656 1655 -1
============================================
+ Hits 11947 11986 +39
+ Misses 711 694 -17
+ Partials 669 645 -24
|
@@ -70,9 +68,9 @@ void testTransformToMulti(boolean prefetch, int[] upstreamRequests) { | |||
Multi<Integer> result = upstream.onItem() | |||
.transformToMulti(i -> Multi.createFrom().items(i, i)) | |||
.concatenate(prefetch); | |||
AssertSubscriber<Integer> ts = new AssertSubscriber<>(5); | |||
AssertSubscriber<Integer> ts = new AssertSubscriber<>(); |
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.
Thanks for digging into that bug @ozangunalp 👍
Minor question: why did you update the test case here? The split 5 upfront then 5 requests scheme had a race condition fixed before, but why not keep it in this test, still?
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.
The ts.awaitSubscription();
in the other test reproduced the test case more consistently.
For this one, during bug fix tests, I had a dropped item, even with this change. So I kept it like that.
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 thanks!
Change how the upstream request is deferred until the next downstream request