From 8f75d31bf75a54e814bf253bc110837ccf8b2d16 Mon Sep 17 00:00:00 2001 From: Giuseppe Villani Date: Fri, 25 Nov 2022 11:00:37 +0100 Subject: [PATCH] lightened ExportS3PerformanceTest --- .../test/java/apoc/export/ExportS3PerformanceTest.java | 9 ++++----- test-utils/build.gradle | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/apoc/export/ExportS3PerformanceTest.java b/core/src/test/java/apoc/export/ExportS3PerformanceTest.java index dbc77840e..8c370635c 100644 --- a/core/src/test/java/apoc/export/ExportS3PerformanceTest.java +++ b/core/src/test/java/apoc/export/ExportS3PerformanceTest.java @@ -3,6 +3,7 @@ import apoc.export.csv.ExportCSV; import apoc.graph.Graphs; import apoc.util.TestUtil; +import apoc.util.Util; import apoc.util.s3.S3BaseTest; import com.amazonaws.services.s3.model.S3Object; import org.junit.BeforeClass; @@ -14,6 +15,7 @@ import java.io.IOException; import java.time.Duration; import java.time.Instant; +import java.util.stream.IntStream; import static apoc.ApocConfig.APOC_EXPORT_FILE_ENABLED; import static apoc.ApocConfig.apocConfig; @@ -45,11 +47,8 @@ public static void setUp() throws Exception { @Test public void testExportAllCsvS3() throws Exception { System.out.println("Data creation started."); - // create large data (> 100 MB) - for (int i=0; i<555000; i++) { - String query = String.format("CREATE (f:User1:User {name:'foo%d',age:%d,male:true,kids:['a','b','c']})-[:KNOWS]->(b:User {name:'bar%d',age:%d}),(c:User {age:12})", i, i, i, i ); - db.executeTransactionally(query); - } + final String query = Util.readResourceFile("movies.cypher"); + IntStream.range(0, 5000).forEach(__-> db.executeTransactionally(query)); System.out.println("Data creation finished."); System.out.println("Test started."); diff --git a/test-utils/build.gradle b/test-utils/build.gradle index 9d424f97b..5aed7c253 100644 --- a/test-utils/build.gradle +++ b/test-utils/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation group: 'org.neo4j', name: 'neo4j-io', version: neo4jVersionEffective, classifier: "tests" implementation group: 'org.gradle', name: 'gradle-tooling-api', version: '7.2' implementation group: 'org.jetbrains', name: 'annotations', version: "17.0.0" - implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.270' + implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.348' }