Skip to content

Commit 35d58d0

Browse files
committed
Enable Authorization Testkit tests for reactive backend (neo4j#1063)
This update also makes sure that `DemandConsumer` completes immediately when there is no unconsumed demand.
1 parent 43841a2 commit 35d58d0

File tree

1 file changed

+6
-1
lines changed
  • testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests

1 file changed

+6
-1
lines changed

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/SessionClose.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ private DemandConsumer( RxBlockingSubscriber<T> subscriber, AtomicLong unfulfill
129129
this.unfulfilledDemandCounter = unfulfilledDemandCounter;
130130

131131
subscriber.getCompletionStage().whenComplete( this::onComplete );
132-
if ( this.unfulfilledDemandCounter.get() > 0 )
132+
long unfulfilledDemand = this.unfulfilledDemandCounter.get();
133+
if ( unfulfilledDemand == 0 )
134+
{
135+
completedStage.complete( CompletionReason.REQUESTED_DEMAND_CONSUMED );
136+
}
137+
else if ( unfulfilledDemand > 0 )
133138
{
134139
setupNextSignalConsumer();
135140
}

0 commit comments

Comments
 (0)