Skip to content

=tck #427 TCK should stress subscriber rule 2.5 in concurrent setting #428

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

Closed

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Mar 12, 2018

Test implementation for #427 TCK should stress subscriber rule 2.5 in concurrent setting

Discussion so far in the ticket.

@@ -231,6 +234,77 @@ public String toString() {
}};
}

@Override @Test
public void required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignalConcurrently() throws Throwable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Travis may not have the proper concurrency to verify this. I'm constantly facing the problem testing race conditions in RxJava requiring two dedicated cores running practically at the same time to trigger small windows around CAS instructions.

This could be the reason the build failed: https://travis-ci.org/reactive-streams/reactive-streams-jvm/jobs/352388267#L1483

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, quite likely it'll be a pain to have travis execute this as intended. Let's discuss on the ticket first though if this PR makes sense or not, I'm fine with just dropping if if we agree this simply rides on the Publisher's guarnatees spec-wise

invokeOnSubscribeConcurrentlyTasks.add(invokeOnSubscribe);
}

List<Future<Void>> futures = Executors.newFixedThreadPool(16).invokeAll(invokeOnSubscribeConcurrentlyTasks);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this Executor shut down when no longer needed? Also having more threads than cores may actually reduce the chance of hitting the desired concurrency effect because of the increased context switching among threads.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it should; first let's agree if this PR makes sense or not -- as we started in the ticket, if not, no reason to spend time polishing it ;-)

@ktoso
Copy link
Contributor Author

ktoso commented Mar 12, 2018

Closing, no need to guard against this -- it rides on guarantees made by Publisher in 1.3

@ktoso ktoso closed this Mar 12, 2018
@ktoso ktoso deleted the wip-improve-2.5-coverage branch March 12, 2018 16:12
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.

2 participants