Skip to content

+TCK verifyNoAsyncErrors now by default waits, fixes spec111 #240

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Reactive Streams project welcomes contributions from anybody who wants to pa

## Copyright Statement

The aforementioned waiver of copyrights and other rights is represented by the addition of a line to the file [CopyrightWaivers.txt](https://github.com/reactive-streams/reactive-streams/blob/master/CopyrightWaivers.txt). For a pull request to be considered every contributor must have signed the copyright statement in this way; this may be included within that same pull request.
The aforementioned waiver of copyrights and other rights is represented by the addition of a line to the file [CopyrightWaivers.txt](https://github.com/reactive-streams/reactive-streams-jvm/blob/master/CopyrightWaivers.txt). For a pull request to be considered every contributor must have signed the copyright statement in this way; this may be included within that same pull request.

## Gatekeepers

Expand Down
2 changes: 1 addition & 1 deletion CopyrightWaivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ waiver with respect to the entirety of my contributions.

The text of the copyright statement is included in the COPYING file at the root
of the reactive-streams repository at
https://github.com/reactive-streams/reactive-streams/blob/master/COPYING.
https://github.com/reactive-streams/reactive-streams-jvm/blob/master/COPYING.

Underwriting parties:

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ followed by a possibly unbounded number of `onNext` signals (as requested by `Su

### SPECIFICATION

#### 1. Publisher ([Code](https://github.com/reactive-streams/reactive-streams/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Publisher.java))
#### 1. Publisher ([Code](https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Publisher.java))

```java
public interface Publisher<T> {
Expand All @@ -96,7 +96,7 @@ public interface Publisher<T> {

[<a name="footnote-1-1">1</a>] : A stateful Publisher can be overwhelmed, bounded by a finite number of underlying resources, exhausted, shut-down or in a failed state.

#### 2. Subscriber ([Code](https://github.com/reactive-streams/reactive-streams/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Subscriber.java))
#### 2. Subscriber ([Code](https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Subscriber.java))

```java
public interface Subscriber<T> {
Expand Down Expand Up @@ -125,7 +125,7 @@ public interface Subscriber<T> {

[<a name="footnote-2-1">1</a>] : See JMM definition of Happen-Before in section 17.4.5. on http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html

#### 3. Subscription ([Code](https://github.com/reactive-streams/reactive-streams/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Subscription.java))
#### 3. Subscription ([Code](https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Subscription.java))

```java
public interface Subscription {
Expand Down Expand Up @@ -162,7 +162,7 @@ public interface Subscription {

A `Subscription` is shared by exactly one `Publisher` and one `Subscriber` for the purpose of mediating the data exchange between this pair. This is the reason why the `subscribe()` method does not return the created `Subscription`, but instead returns `void`; the `Subscription` is only passed to the `Subscriber` via the `onSubscribe` callback.

#### 4.Processor ([Code](https://github.com/reactive-streams/reactive-streams/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Processor.java))
#### 4.Processor ([Code](https://github.com/reactive-streams/reactive-streams-jvm/blob/v1.0.0.RC3/api/src/main/java/org/reactivestreams/Processor.java))

```java
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {
Expand Down
10 changes: 5 additions & 5 deletions tck/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reactive Streams TCK #

The purpose of the *Reactive Streams Technology Compatibility Kit* (from here on referred to as: *the TCK*) is to guide
and help Reactive Streams library implementers to validate their implementations against the rules defined in [the Specification](https://github.com/reactive-streams/reactive-streams).
and help Reactive Streams library implementers to validate their implementations against the rules defined in [the Specification](https://github.com/reactive-streams/reactive-streams-jvm).

The TCK is implemented using **plain Java (1.6)** and **TestNG** tests, and should be possible to use from other languages and testing libraries (such as Scala, Groovy, JRuby or others).

Expand Down Expand Up @@ -30,7 +30,7 @@ The TCK is provided as binary artifact on [Maven Central](http://search.maven.or
</dependency>
```

Please refer to the [Reactive Streams Specification](https://github.com/reactive-streams/reactive-streams) for the current latest version number. Make sure that the API and TCK dependency versions are equal.
Please refer to the [Reactive Streams Specification](https://github.com/reactive-streams/reactive-streams-jvm) for the current latest version number. Make sure that the API and TCK dependency versions are equal.

### Types of tests

Expand All @@ -44,7 +44,7 @@ Specification rule abides the following naming convention: `spec###_DESC` where:
* `DESC` is a short explanation of what exactly is being tested in this test case, as sometimes one Rule may have multiple test cases in order to cover the entire Rule.

```java
// Verifies rule: https://github.com/reactive-streams/reactive-streams#1.1
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.1
@Test public void required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements() throws Throwable
// ...
}
Expand Down Expand Up @@ -195,7 +195,7 @@ Notable configuration options include:
### Timeout configuration
Publisher tests make use of two kinds of timeouts, one is the `defaultTimeoutMillis` which corresponds to all methods used
within the TCK which await for something to happen. The other timeout is `publisherReferenceGCTimeoutMillis` which is only used in order to verify
[Rule 3.13](https://github.com/reactive-streams/reactive-streams#3.13) which defines that subscriber references MUST be dropped
[Rule 3.13](https://github.com/reactive-streams/reactive-streams-jvm#3.13) which defines that subscriber references MUST be dropped
by the Publisher.

In order to configure these timeouts (for example when running on a slow continious integtation machine), you can either:
Expand Down Expand Up @@ -505,7 +505,7 @@ public class SkippingIdentityProcessorTest extends IdentityProcessorVerification

## Upgrade story

**TODO** - What is our story about updating the TCK? How do we make sure that implementations don't accidentally miss some change in the spec, if the TCK is unable to fail verify the new behavior? Comments are very welcome, discussion about this is under-way in [Issue #99 – TCK Upgrade Story](https://github.com/reactive-streams/reactive-streams/issues/99).
**TODO** - What is our story about updating the TCK? How do we make sure that implementations don't accidentally miss some change in the spec, if the TCK is unable to fail verify the new behavior? Comments are very welcome, discussion about this is under-way in [Issue #99 – TCK Upgrade Story](https://github.com/reactive-streams/reactive-streams-jvm/issues/99).

## Using the TCK from other languages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public long maxElementsFromPublisher() {
* {@code Subscription} actually solves the "unbounded recursion" problem by not allowing the number of
* recursive calls to exceed the number returned by this method.
*
* @see <a href="https://github.com/reactive-streams/reactive-streams#3.3">reactive streams spec, rule 3.3</a>
* @see <a href="https://github.com/reactive-streams/reactive-streams-jvm#3.3">reactive streams spec, rule 3.3</a>
* @see PublisherVerification#required_spec303_mustNotAllowUnboundedRecursion()
*/
public long boundedDepthOfOnNextAndRequestRecursion() {
Expand Down Expand Up @@ -208,7 +208,7 @@ public void required_validate_boundedDepthOfOnNextAndRequestRecursion() throws E
}

/////////////////////// DELEGATED TESTS, A PROCESSOR "IS A" PUBLISHER //////////////////////
// Verifies rule: https://github.com/reactive-streams/reactive-streams#4.1
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#4.1

@Test
public void required_createPublisher1MustProduceAStreamOfExactly1Element() throws Throwable {
Expand Down Expand Up @@ -380,7 +380,7 @@ public void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue()
publisherVerification.required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue();
}

// Verifies rule: https://github.com/reactive-streams/reactive-streams#1.4
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.4
// for multiple subscribers
@Test
public void required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError() throws Throwable {
Expand Down Expand Up @@ -408,14 +408,14 @@ public TestSetup apply(Long aLong) throws Throwable {
sub1.expectError(ex);
sub2.expectError(ex);

env.verifyNoAsyncErrors();
env.verifyNoAsyncErrorsNoDelay();
}};
}
});
}

////////////////////// SUBSCRIBER RULES VERIFICATION ///////////////////////////
// Verifies rule: https://github.com/reactive-streams/reactive-streams#4.1
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#4.1

// A Processor
// must obey all Subscriber rules on its consuming side
Expand Down Expand Up @@ -480,12 +480,12 @@ public void mustImmediatelyPassOnOnErrorEventsReceivedFromItsUpstreamToItsDownst
sendError(ex);
sub.expectError(ex); // "immediately", i.e. without a preceding request

env.verifyNoAsyncErrors();
env.verifyNoAsyncErrorsNoDelay();
}};
}

/////////////////////// DELEGATED TESTS, A PROCESSOR "IS A" SUBSCRIBER //////////////////////
// Verifies rule: https://github.com/reactive-streams/reactive-streams#4.1
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#4.1

@Test
public void required_exerciseWhiteboxHappyPath() throws Throwable {
Expand Down Expand Up @@ -668,7 +668,7 @@ public TestSetup apply(Long subscribers) throws Throwable {
sub1.expectCompletion(env.defaultTimeoutMillis());
sub2.expectCompletion(env.defaultTimeoutMillis());

env.verifyNoAsyncErrors();
env.verifyNoAsyncErrorsNoDelay();
}};
}
});
Expand Down
Loading