Skip to content

Commit 145151e

Browse files
authored
Enable Authorization Testkit tests for reactive backend (#1063)
This update also makes sure that `DemandConsumer` completes immediately when there is no unconsumed demand.
1 parent b9c9ef1 commit 145151e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

+6-1
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
}

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ public class StartTest implements TestkitRequest
5151
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestSessionRun\\.test_raises_error_on_session_run$", skipMessage );
5252
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestTxRun\\.test_raises_error_on_tx(_func)?_run", skipMessage );
5353
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestTxRun\\.test_failed_tx_run_allows(_skipping)?_rollback", skipMessage );
54+
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestAuthorizationV\\dx\\d\\.test_should_fail_with_auth_expired_on_run_using_tx_run$", skipMessage );
55+
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestAuthorizationV\\dx\\d\\.test_should_fail_with_token_expired_on_run_using_tx_run$", skipMessage );
5456
skipMessage = "Requires investigation";
55-
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestAuthorizationV4x1\\..*$", skipMessage );
56-
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestAuthorizationV4x3\\..*$", skipMessage );
57-
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestNoRoutingAuthorization\\..*$", skipMessage );
5857
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestDirectConnectionRecvTimeout\\..*$", skipMessage );
5958
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestRoutingConnectionRecvTimeout\\..*$", skipMessage );
6059
REACTIVE_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestRoutingConnectionRecvTimeout\\.test_timeout$", skipMessage );

0 commit comments

Comments
 (0)