Skip to content

Cancel the subscription after receiving all of the pertinent emissions (#259) #260

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
merged 2 commits into from
Apr 8, 2015

Conversation

ldaley
Copy link
Contributor

@ldaley ldaley commented Apr 5, 2015

See #259.

@ldaley
Copy link
Contributor Author

ldaley commented Apr 5, 2015

@ktoso can you provide some guidance on how you want this tested please.

@ktoso
Copy link
Contributor

ktoso commented Apr 6, 2015

I think adding a test that has a simple synchronous publisher that checks for the cancellation signal while spinning would be good enough here - we just want to show that such test will properly terminate - right?

@ktoso
Copy link
Contributor

ktoso commented Apr 6, 2015

Got a few mins more time, more hints which should help you get started :-)

Put the test inside PublisherVerificationTest, the used naming format is testedMethodName_shouldPass[_optionalDesctiptionWhen]:

In our case I'd go with:

@Test
public void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue_forSynchronousPublisher() throws Throwable {

@viktorklang
Copy link
Contributor

👍

…axValue' completes in a timely manner for fully synchronous publishers (reactive-streams#259).
@ldaley
Copy link
Contributor Author

ldaley commented Apr 8, 2015

@ktoso ping.

}).required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue();

// 11 due to the implementation of this particular TCK test (see impl)
Assert.assertEquals(sent.get(), 11);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd skip this check, the test "passes" if it doesn't end up infinitely publishing - it's true that it is 11 signals but I wouldn't test for this number.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since it's the verification test, isn't it fine to be specific?

Copy link
Contributor

Choose a reason for hiding this comment

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

No strong feelings about it, can stay as is :)

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is wrong I'd want to see it removed, but from a cursory inspection I don't see that it could be problematic, but if I am wrong, please do tell me!

Copy link
Contributor

Choose a reason for hiding this comment

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

It's definitely not wrong, just depending on the internally+arbitrarily chosen value inside of required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue.

You're right though that these are very specific tests so keeping as-is may be a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we change the underlying TCK impl then we'd also have to change this assertion, I think that's good.

@ktoso
Copy link
Contributor

ktoso commented Apr 8, 2015

Yup good one, LGTM (I think I'd skip the 11 check, it's a bit internals looking, no need for it IMO).
Thanks @alkemist!

// @viktorklang @smaldini I think we'd like to release an RC with this fix for final validation before 1.0, sounds like a plan?

@ldaley
Copy link
Contributor Author

ldaley commented Apr 8, 2015

@viktorklang
Copy link
Contributor

@reactive-streams/contributors Let's merge this TCK fix in and issue a new RC immediately to get feedback.

@viktorklang viktorklang modified the milestone: 1.0.0.RC5 Apr 8, 2015
@viktorklang
Copy link
Contributor

Merging

viktorklang added a commit that referenced this pull request Apr 8, 2015
Cancel the subscription after receiving all of the pertinent emissions (#259)
@viktorklang viktorklang merged commit e57f4b9 into reactive-streams:master Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants