-
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: Test cleanup #6119
2.x: Test cleanup #6119
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #6119 +/- ##
============================================
- Coverage 98.25% 98.25% -0.01%
- Complexity 6191 6194 +3
============================================
Files 667 667
Lines 44861 44861
Branches 6213 6213
============================================
- Hits 44080 44078 -2
- Misses 237 239 +2
Partials 544 544
Continue to review full report at Codecov.
|
@@ -188,4 +188,77 @@ public void completableSourceAsMs() throws Exception { | |||
public void observableAsC() throws Exception { | |||
findPattern("Observable<.*>\\s+c\\b"); | |||
} | |||
|
|||
@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.
👍
findPattern("Single<.*>\\s+flowable\\b"); | ||
} | ||
|
||
public void observerAsSubscriber() throws Exception { |
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.
missing @Test
findPattern("Observer<.*>\\s+subscriber[0-9]?\\b"); | ||
} | ||
|
||
public void observerAsS() throws Exception { |
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.
missing @Test
findPattern("Observer\\s+s[0-9]?\\b"); | ||
} | ||
|
||
@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.
nit: indent
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'll indent it shortly.
@@ -466,35 +467,40 @@ public boolean test(Integer n, Throwable e) throws Exception { | |||
|
|||
@Test | |||
public void retryBiPredicateDisposeRace() { | |||
for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) { | |||
final PublishProcessor<Integer> pp = PublishProcessor.create(); | |||
RxJavaPlugins.setErrorHandler(Functions.emptyConsumer()); |
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.
hm, did it flake?
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.
One valid outcome was an error that was flooding the console. It is not interesting here so itbis suppressed.
@@ -118,7 +118,9 @@ public void requestMore(long n) { | |||
|
|||
@Override | |||
public void onStart() { | |||
request(initialRequest); | |||
if (initialRequest > 0) { |
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.
hmm, why though? Isn't it normally validated by SubscriptionHelper#validate()
?
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.
Yes, that's how I found this mistake. The intention wasn't to trigger the validation but simply not request upfront.
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.
was it just going to RxJavaPlugins and not failing the 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.
Yes, only that default stacktrace printout of the validation error.
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 see
If you want I can make a JUnit Rule that'll by default check that there are no RxJavaPlugin errors and an annotation to allow errors on specific tests
Mathematical representation of this code review: Each "Load diff" was technically getting me closer… I've tried my best, hope I didn't miss anything. |
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.
Good change 👍
This PR cleans up the tests:
Subscriber
s fromo
andobserver
to the propersubscriber
Flowable
s fromo
andobservable
to the more appropriatef
andflowable
CheckLocalVariablesInTests
to support the previous two points.