Skip to content

Commit f7fdc11

Browse files
committed
Consume query results in stress test
Not consuming them can make the database stop accepting new commands because its outgoing network buffer is too full. Clients are expected to consume results within reasonable time, otherwise database can disable auto-read for the connection.
1 parent 4b45e63 commit f7fdc11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

driver/src/test/java/org/neo4j/driver/v1/stress/AbstractStressTestBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import org.neo4j.driver.v1.Record;
5959
import org.neo4j.driver.v1.Session;
6060
import org.neo4j.driver.v1.StatementResult;
61+
import org.neo4j.driver.v1.StatementResultCursor;
6162
import org.neo4j.driver.v1.Transaction;
6263
import org.neo4j.driver.v1.types.Node;
6364
import org.neo4j.driver.v1.util.DaemonThreadFactory;
@@ -550,11 +551,11 @@ private static void createNodeInTx( Transaction tx, boolean async, int nodeIndex
550551

551552
if ( async )
552553
{
553-
tx.runAsync( query, params );
554+
tx.runAsync( query, params ).thenCompose( StatementResultCursor::consumeAsync );
554555
}
555556
else
556557
{
557-
tx.run( query, params );
558+
tx.run( query, params ).consume();
558559
}
559560
}
560561

0 commit comments

Comments
 (0)