Skip to content

Commit d03e9f2

Browse files
author
Zhen Li
committed
Re-enabling all muted tests.
The tests were failing because in 4.0 we introduced a new parallel runtime which does not preserve the order of the unwind lists. As the driver tests are testing the driver not missing any records rather than cypher semantics, we change the query to preserve order in our test instead.
1 parent de7dab0 commit d03e9f2

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

driver/src/test/java/org/neo4j/driver/integration/ResultStreamIT.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@
2727
import java.util.concurrent.atomic.AtomicReference;
2828
import java.util.stream.IntStream;
2929

30-
import org.neo4j.driver.internal.util.DisabledOnNeo4jWith;
3130
import org.neo4j.driver.Record;
3231
import org.neo4j.driver.StatementResult;
3332
import org.neo4j.driver.Transaction;
3433
import org.neo4j.driver.Value;
3534
import org.neo4j.driver.exceptions.ClientException;
3635
import org.neo4j.driver.exceptions.NoSuchRecordException;
37-
import org.neo4j.driver.internal.util.Neo4jFeature;
3836
import org.neo4j.driver.summary.ResultSummary;
3937
import org.neo4j.driver.util.ParallelizableIT;
4038
import org.neo4j.driver.util.SessionExtension;
@@ -282,13 +280,12 @@ void shouldConvertImmediatelyFailingStatementResultToStream()
282280
}
283281

284282
@Test
285-
@DisabledOnNeo4jWith( Neo4jFeature.NO_STREAMING )
286283
void shouldConvertEventuallyFailingStatementResultToStream()
287284
{
288285
List<Integer> seen = new ArrayList<>();
289286

290287
ClientException e = assertThrows( ClientException.class,
291-
() -> session.run( "UNWIND range(5, 0, -1) AS x RETURN x / x" )
288+
() -> session.run( "CYPHER runtime=interpreted UNWIND range(5, 0, -1) AS x RETURN x / x" )
292289
.stream()
293290
.forEach( record -> seen.add( record.get( 0 ).asInt() ) ) );
294291

driver/src/test/java/org/neo4j/driver/integration/SessionIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
import static org.neo4j.driver.internal.util.Matchers.arithmeticError;
9595
import static org.neo4j.driver.internal.util.Matchers.connectionAcquisitionTimeoutError;
9696
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V4;
97-
import static org.neo4j.driver.internal.util.Neo4jFeature.NO_STREAMING;
9897
import static org.neo4j.driver.util.DaemonThreadFactory.daemon;
9998
import static org.neo4j.driver.util.Neo4jRunner.DEFAULT_AUTH_TOKEN;
10099

@@ -865,12 +864,11 @@ void shouldNotRetryOnConnectionAcquisitionTimeout()
865864
}
866865

867866
@Test
868-
@DisabledOnNeo4jWith( NO_STREAMING )
869867
void shouldAllowConsumingRecordsAfterFailureInSessionClose()
870868
{
871869
Session session = neo4j.driver().session();
872870

873-
StatementResult result = session.run( "UNWIND [2, 4, 8, 0] AS x RETURN 32 / x" );
871+
StatementResult result = session.run( "CYPHER runtime=interpreted UNWIND [2, 4, 8, 0] AS x RETURN 32 / x" );
874872

875873
ClientException e = assertThrows( ClientException.class, session::close );
876874
assertThat( e, is( arithmeticError() ) );

driver/src/test/java/org/neo4j/driver/integration/async/AsyncSessionIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
import static org.neo4j.driver.internal.util.Matchers.containsResultAvailableAfterAndResultConsumedAfter;
8181
import static org.neo4j.driver.internal.util.Matchers.syntaxError;
8282
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V3;
83-
import static org.neo4j.driver.internal.util.Neo4jFeature.NO_STREAMING;
8483
import static org.neo4j.driver.util.TestUtil.await;
8584
import static org.neo4j.driver.util.TestUtil.awaitAll;
8685

@@ -156,10 +155,9 @@ void shouldFailForIncorrectQuery()
156155
}
157156

158157
@Test
159-
@DisabledOnNeo4jWith( NO_STREAMING )
160158
void shouldFailWhenQueryFailsAtRuntime()
161159
{
162-
StatementResultCursor cursor = await( session.runAsync( "UNWIND [1, 2, 0] AS x RETURN 10 / x" ) );
160+
StatementResultCursor cursor = await( session.runAsync( "CYPHER runtime=interpreted UNWIND [1, 2, 0] AS x RETURN 10 / x" ) );
163161

164162
Record record1 = await( cursor.nextAsync() );
165163
assertNotNull( record1 );

driver/src/test/java/org/neo4j/driver/integration/reactive/RxStatementResultIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626

2727
import org.neo4j.driver.Record;
2828
import org.neo4j.driver.exceptions.ClientException;
29-
import org.neo4j.driver.internal.util.DisabledOnNeo4jWith;
3029
import org.neo4j.driver.internal.util.EnabledOnNeo4jWith;
31-
import org.neo4j.driver.reactive.RxStatementResult;
3230
import org.neo4j.driver.reactive.RxSession;
31+
import org.neo4j.driver.reactive.RxStatementResult;
3332
import org.neo4j.driver.summary.ResultSummary;
3433
import org.neo4j.driver.summary.StatementType;
3534
import org.neo4j.driver.util.DatabaseExtension;
@@ -45,7 +44,6 @@
4544
import static org.junit.jupiter.api.Assertions.assertTrue;
4645
import static org.neo4j.driver.Values.parameters;
4746
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V4;
48-
import static org.neo4j.driver.internal.util.Neo4jFeature.NO_STREAMING;
4947

5048
@EnabledOnNeo4jWith( BOLT_V4 )
5149
@ParallelizableIT
@@ -283,12 +281,11 @@ void shouldDiscardRecords()
283281
}
284282

285283
@Test
286-
@DisabledOnNeo4jWith( NO_STREAMING )
287284
void shouldStreamCorrectRecordsBackBeforeError()
288285
{
289286
RxSession session = neo4j.driver().rxSession();
290287

291-
RxStatementResult result = session.run( "UNWIND range(5, 0, -1) AS x RETURN x / x" );
288+
RxStatementResult result = session.run( "CYPHER runtime=interpreted UNWIND range(5, 0, -1) AS x RETURN x / x" );
292289
StepVerifier.create( Flux.from( result.records() ).map( record -> record.get( 0 ).asInt() ) )
293290
.expectNext( 1 )
294291
.expectNext( 1 )

driver/src/test/java/org/neo4j/driver/internal/util/Neo4jFeature.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public enum Neo4jFeature
2828
SPATIAL_TYPES( v3_4_0 ),
2929
TEMPORAL_TYPES( v3_4_0 ),
3030
BOLT_V3( v3_5_0 ),
31-
BOLT_V4( v4_0_0 ),
32-
NO_STREAMING( v4_0_0 ); // the cypher cannot streaming records before error
31+
BOLT_V4( v4_0_0 );
3332

3433
private final ServerVersion availableFromVersion;
3534

0 commit comments

Comments
 (0)