From 0bfd79504d9c319869b32b3bd941ffee2e50b2fa Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:44:48 -0600 Subject: [PATCH] Add a request for publishers that don't publish an error until there is a request to consistently handle all callbacks --- .../org/reactivestreams/tck/PublisherVerification.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tck/src/main/java/org/reactivestreams/tck/PublisherVerification.java b/tck/src/main/java/org/reactivestreams/tck/PublisherVerification.java index c2f46576..12d1b682 100644 --- a/tck/src/main/java/org/reactivestreams/tck/PublisherVerification.java +++ b/tck/src/main/java/org/reactivestreams/tck/PublisherVerification.java @@ -361,6 +361,10 @@ public void run(final Publisher pub) throws InterruptedException { public void onSubscribe(Subscription subs) { onSubscribeLatch.assertOpen("Only one onSubscribe call expected"); onSubscribeLatch.close(); + + // If the publisher requires a request to publish the error, that follows the spec + // If it does not, this should be a no-op + subs.request(1); } @Override public void onError(Throwable cause) { @@ -527,6 +531,10 @@ public void onError(Throwable cause) { public void onSubscribe(Subscription subs) { onSubscribeLatch.assertOpen("Only one onSubscribe call expected"); onSubscribeLatch.close(); + + // If the publisher requires a request to publish the error, that follows the spec + // If it does not, this should be a no-op + subs.request(1); } }; pub.subscribe(sub);