Skip to content

2.x collect - handle post terminal events #4364

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

Merged

Conversation

davidmoten
Copy link
Collaborator

@davidmoten davidmoten commented Aug 18, 2016

Just looking at moving some recent 1.x bug fixes and tests over to 2.x.

This is my first PR in 2.x so before I proceed adding more tests from 1.x (to this PR) I want to get some feedback on my approach. In particular in the test testCollectorFailureDoesNotResultInTwoErrorEmissions is the Flowable creation method ok?

list.add(t);
}
}).subscribe(ts);
ts.assertNoValues();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd instead throw TestException("Forced failure") and then simply

Flowable.just(1).collect(...)
.test()
.assertFailureAndMessage(TestException.class, "Forced failure");

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I love the .test method on this!

@akarnokd akarnokd added the Bug label Aug 18, 2016
@akarnokd akarnokd added this to the 2.0 RC 1 milestone Aug 18, 2016
@akarnokd
Copy link
Member

If you'd make it more concise, that would be great. Also note that most Flowable operators have an Observable counterpart so it would be nice if such changes would contain the fix & tests for both.

@codecov-io
Copy link

codecov-io commented Aug 18, 2016

Current coverage is 69.33% (diff: 100%)

Merging #4364 into 2.x will increase coverage by 0.05%

@@                2.x      #4364   diff @@
==========================================
  Files           454        454          
  Lines         32483      32492     +9   
  Methods           0          0          
  Messages          0          0          
  Branches       5204       5207     +3   
==========================================
+ Hits          22504      22529    +25   
+ Misses         7776       7764    -12   
+ Partials       2203       2199     -4   

Powered by Codecov. Last update 7a1a4af...2931f24

@davidmoten
Copy link
Collaborator Author

If you'd make it more concise, that would be great. Also note that most Flowable operators have an Observable counterpart so it would be nice if such changes would contain the fix & tests for both.

Can do.

@davidmoten davidmoten force-pushed the 2.x-collect-handle-post-terminal-events branch 2 times, most recently from 2dddd6c to c2fe8e9 Compare August 20, 2016 07:46
@akarnokd
Copy link
Member

I was trying to avoid this class till now. Will you be able to finish what you wanted till Thursday or may I do it?

@davidmoten davidmoten force-pushed the 2.x-collect-handle-post-terminal-events branch from c2fe8e9 to aba5f4a Compare August 22, 2016 23:06
@davidmoten
Copy link
Collaborator Author

@akarnokd I rebased but io.reactivex.Optional disappeared and I was using it in tests. I'll add it back in internal test package.

@davidmoten
Copy link
Collaborator Author

davidmoten commented Aug 23, 2016

@akarnokd the work is done for Flowable and I have done the work for Observable as well but is on my laptop at home so will finish PR tonight (in about 11 hours time).

@davidmoten
Copy link
Collaborator Author

davidmoten commented Aug 23, 2016

@akarnokd I'm noticing that RxJava 2.x is really slow to compile (2 minutes) in Eclipse 4.5.1 and 4.6 (say after switching branches). Have you noticed that? Got any tips?

@davidmoten davidmoten force-pushed the 2.x-collect-handle-post-terminal-events branch from aba5f4a to e9bac96 Compare August 23, 2016 02:36
@akarnokd
Copy link
Member

Please try without Optional. Yes Eclipse is slow if you change Observable and Flowable, it doesn't like the cycle between the base classes and their implementations. Not sure why, maybe collecting metadata makes is much slower.

@davidmoten davidmoten force-pushed the 2.x-collect-handle-post-terminal-events branch from e9bac96 to 2931f24 Compare August 23, 2016 11:31
@davidmoten
Copy link
Collaborator Author

I've removed Optional. Would you like to assess this PR as it stands without the Observable fix that I can do in another PR? You guys are moving fast (as usual) and keeping PRs open a while is a bit of an obstacle.

@akarnokd
Copy link
Member

👍

@akarnokd akarnokd merged commit da88837 into ReactiveX:2.x Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants