-
Notifications
You must be signed in to change notification settings - Fork 534
+TCK: Provide helper publisher (rebased) #193
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
+TCK: Provide helper publisher (rebased) #193
Conversation
…iber tests + When subscriber verifications are extended using Integer we can use the existing publisher implementations from examples to drive the tests. This allows implementers who only care about implementing Subscribers to not care at all about implementing Publishers + In case the subscriber verification is extended using a custom signal type (defined as "not Integer") we do not magically generate a Publisher of this type, but instead fail the tests telling the implementer that he/she will need to implement a custom helperPublisher which is exactly what we have up until now always demanded from implementations. + We also provide tests to verify the test failures work as expected, and that the messages are indeed helpful. + Updated TCK README.md to clarify when to implement a custom publisher + fixed mistakenly added `<T>` on NumberPublisher - it is bound to Ints + TCK now depends on examples, as it uses the well documented async publisher to provide the default publisher for numbers. As well as in order to allow implementers to reuse those publishers when implementing custom Publishers to drive their Subscriber specs. ! Moved away from createHelper to createElement style of testing subscribers
It should not use the helper publisher as it may signal asynchronously as well as onComplete in undefined ways - we need to control the publisher in this case because of the very specific test scenario
Yes, we have trouble - here's the failures:
I think they all originate back to the publisher now being async, need to look into this in-depth (setting expectations here though - in-depth looking I'll probably be only able to do from the 4th Jan on). |
Isn't this just a case of TravisCI being slower than our local machines? |
@ktoso and the next failure is just due to the first failure, since that ABQ is just 1 element big? |
bc4729b
to
8769da9
Compare
Brain stormed with @viktorklang and fixed the "timeout is too little for travis" problem by introducing env overrides for all timeouts. They also got default values now, please check ktoso@8769da9 for changes around that. In general it's now possible to Tests passed on Travis now with increased timeouts. But in general this PR should be OK now, unless I made some silly typo... Please review :-) |
Since it is the following test that fails: @Test // Must be here for TestNG to find and run this, do not remove
public class UnboundedIntegerIncrementPublisherTest extends PublisherVerification<Integer> {
private ExecutorService e;
@BeforeClass void before() { e = Executors.newFixedThreadPool(4); }
@AfterClass void after() { if (e != null) e.shutdown(); }
public UnboundedIntegerIncrementPublisherTest() {
super(new TestEnvironment());
}
@Override public Publisher<Integer> createPublisher(long elements) {
return new InfiniteIncrementNumberPublisher(e);
}
@Override public Publisher<Integer> createErrorStatePublisher() {
return null;
}
@Override public long maxElementsFromPublisher() {
return super.publisherUnableToSignalOnComplete();
}
} I'd suggest you have another look at how |
@viktorklang latest commit fixes a "leaked still alive and kicking publisher" which leaked from The new impl is much safer in face of different Publishers, please review ktoso@f58cc7c - the commit message has more details and there's some comments in line explaining rationale on skipping |
8ed7a41
to
f58cc7c
Compare
Awesome that you found the issue, @ktoso! |
4af56c3
to
a588fa0
Compare
Addressed feedback, simplified code a bit - no need for additional configuration method, we're using |
resolves #181 |
a588fa0
to
f6367fe
Compare
return element; | ||
} | ||
|
||
@Override public Publisher<Integer> createHelperPublisher(long elements) { |
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.
This override seems meaningless :)
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, removed!
👍, this looks excellent Konrad! @reactive-streams/contributors please vote for this TCK improvement before monday the 12th of January, or ask for more time to think about this before the 12th. Thanks! |
0138433
to
469d576
Compare
@@ -1,11 +1,13 @@ | |||
language: java | |||
script: | |||
- ./gradlew check | |||
- ./gradlew check --info |
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.
Should this be left in?
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 think so, yes - because +travis run gradle with --info; otherwise we don't get any meaningful stacktraces out of the travis test runs. Without it we get failures on travis which are as helpful as "there was a failure", with --info
we get a stacktrace of the failure.
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.
Fair enough :)
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.
--info
adds a lot of noise.
Add this to about line 27 of build.gradle…
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "failed", "started"
}
}
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.
Nice, thanks @alkemist! I'll include it in this PR then
started
makes more sense than passed
for us I guess, since we care about the skipped ones being run as well.
Aside from comments, LGTM! |
469d576
to
3822a3a
Compare
Since the Publisher could stay alive and keep publishing, and keep getting demand in the recursion depth detecting test it would exceed the buffer size by accumulating these onNext signals, and then cause an error during *a different tests execution* Now we do not accumulate these elements, and also set an explicit limit on how long we try to blow up the recursive stack depth. Stack depth is now also logged in as debug information which should help implementers notice how their imple behave in this scenario. The publisher is now always canceled at the end of this test, in case it did not reach the max nr of elements it is allowed to publish here, nor has it signalled completion.
3822a3a
to
b117f5a
Compare
adb4fb0
to
945bda4
Compare
Thanks to @alkemist for pointing this out
945bda4
to
fdf9a78
Compare
Alright, LGTM, merging this since review feedback has been addressed. |
+TCK: Provide helper publisher (rebased)
This is a rebase of: #186
With the additional commit of making travis failures actually useful - we need
--info
there, otherwise the build log won't include any stacktraces of errors.Locally it works fine for me, so need to see what makes it fail in Viktor's rebase-PR over here: #192