Skip to content

Fail test in case of double onError/onComplete signals #122

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ public void run(WhiteboxTestStage stage) throws InterruptedException {

// cumulative pending > Long.MAX_VALUE
stage.probe.expectErrorWithMessage(IllegalStateException.class, "3.17");

env.verifyNoAsyncErrors(env.defaultTimeoutMillis());
}
});
}
Expand Down Expand Up @@ -626,12 +628,22 @@ public void registerOnNext(T element) {

@Override
public void registerOnComplete() {
elements.complete();
try {
elements.complete();
} catch (IllegalStateException ex) {
// "Queue full", onComplete was already called
env.flop("subscriber::onComplete was called a second time, which is illegal according to Rule 1.7");
}
}

@Override
public void registerOnError(Throwable cause) {
error.complete(cause);
try {
error.complete(cause);
} catch (IllegalStateException ex) {
// "Queue full", onError was already called
env.flop("subscriber::onError was called a second time, which is illegal according to Rule 1.7");
}
}

public T expectNext() throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void verifyNoAsyncErrors() {
/** If {@code TestEnvironment#printlnDebug} is true, print debug message to std out. */
public void debug(String msg) {
if (printlnDebug)
System.out.println(msg);
System.out.println("[TCK-DEBUG] " + msg);
}

// ---- classes ----
Expand Down