From 716388c092310fd643803ad4961401ce4ba189e3 Mon Sep 17 00:00:00 2001 From: vga91 Date: Mon, 2 Sep 2024 09:40:03 +0200 Subject: [PATCH] try fixing codeartifact docker timeout exception --- build.gradle | 2 +- .../src/test/java/apoc/MissingExtraDependenciesTest.java | 2 ++ extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java | 2 ++ .../src/test/java/apoc/neo4j/docker/CoreExtendedTest.java | 4 +++- .../java/apoc/neo4j/docker/CypherEnterpriseExtendedTest.java | 2 ++ extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java | 2 ++ .../test/java/apoc/neo4j/docker/SystemDbEnterpriseTest.java | 3 ++- .../src/test/java/apoc/neo4j/docker/TTLMultiDbTest.java | 2 ++ .../src/test/java/apoc/neo4j/docker/UUIDMultiDbTest.java | 2 ++ 9 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e2c750d55c..6130464f22 100644 --- a/build.gradle +++ b/build.gradle @@ -154,6 +154,6 @@ ext { neo4jVersion = "5.23.0" // instead we apply the override logic here neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : neo4jVersion - testContainersVersion = '1.18.3' + testContainersVersion = '1.19.1' apacheArrowVersion = '15.0.0' } diff --git a/extended-it/src/test/java/apoc/MissingExtraDependenciesTest.java b/extended-it/src/test/java/apoc/MissingExtraDependenciesTest.java index 9cc96887f0..49702168c8 100644 --- a/extended-it/src/test/java/apoc/MissingExtraDependenciesTest.java +++ b/extended-it/src/test/java/apoc/MissingExtraDependenciesTest.java @@ -7,6 +7,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.neo4j.driver.Session; +import org.testcontainers.containers.wait.strategy.Wait; import java.net.MalformedURLException; import java.net.URL; @@ -36,6 +37,7 @@ public class MissingExtraDependenciesTest { @BeforeClass public static void setUp() throws Exception { neo4jContainer = createEnterpriseDB(List.of(TestContainerUtil.ApocPackage.EXTENDED), true); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); session = neo4jContainer.getSession(); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java b/extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java index df3ba3eaac..9dd76029a6 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java @@ -25,6 +25,7 @@ import org.neo4j.graphdb.RelationshipType; import org.neo4j.test.rule.DbmsRule; import org.neo4j.test.rule.ImpermanentDbmsRule; +import org.testcontainers.containers.wait.strategy.Wait; import java.time.LocalTime; import java.time.OffsetTime; @@ -60,6 +61,7 @@ public class BoltTest { @BeforeClass public static void setUp() throws Exception { neo4jContainer = createEnterpriseDB(List.of(ApocPackage.EXTENDED, ApocPackage.CORE), true).withInitScript("init_neo4j_bolt.cypher"); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); TestUtil.registerProcedure(db, Bolt.class, ExportCypher.class, Cypher.class, PathExplorer.class, GraphRefactoring.class); BOLT_URL = getBoltUrl().replaceAll("'", ""); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/CoreExtendedTest.java b/extended-it/src/test/java/apoc/neo4j/docker/CoreExtendedTest.java index 0236fcc786..6c79291728 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/CoreExtendedTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/CoreExtendedTest.java @@ -8,6 +8,7 @@ import org.neo4j.driver.Record; import org.neo4j.driver.Result; import org.neo4j.driver.Session; +import org.testcontainers.containers.wait.strategy.Wait; import java.util.HashMap; import java.util.List; @@ -32,6 +33,7 @@ public void checkForCoreAndExtended() { try(Neo4jContainerExtension neo4jContainer = createEnterpriseDB(List.of(ApocPackage.CORE, ApocPackage.EXTENDED), true) .withNeo4jConfig("dbms.transaction.timeout", "60s") .withEnv(APOC_IMPORT_FILE_ENABLED, "true")) { + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); Session session = neo4jContainer.getSession(); @@ -54,7 +56,7 @@ public void matchesSpreadsheet() { try(Neo4jContainerExtension neo4jContainer = createEnterpriseDB(List.of(TestContainerUtil.ApocPackage.CORE, TestContainerUtil.ApocPackage.EXTENDED), true) .withNeo4jConfig("dbms.transaction.timeout", "60s") .withEnv(APOC_IMPORT_FILE_ENABLED, "true")) { - + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); Session session = neo4jContainer.getSession(); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/CypherEnterpriseExtendedTest.java b/extended-it/src/test/java/apoc/neo4j/docker/CypherEnterpriseExtendedTest.java index 864eca7c6a..757d2ddb8e 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/CypherEnterpriseExtendedTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/CypherEnterpriseExtendedTest.java @@ -13,6 +13,7 @@ import org.neo4j.driver.Session; import org.neo4j.driver.types.Node; import org.neo4j.driver.types.Relationship; +import org.testcontainers.containers.wait.strategy.Wait; import java.io.File; import java.nio.charset.StandardCharsets; @@ -69,6 +70,7 @@ public static void beforeAll() { // We build the project, the artifact will be placed into ./build/libs neo4jContainer = createEnterpriseDB(List.of(ApocPackage.EXTENDED), true) .withNeo4jConfig("dbms.transaction.timeout", "60s"); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); session = neo4jContainer.getSession(); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java b/extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java index 64ae293365..a4f5238e44 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java @@ -9,6 +9,7 @@ import org.junit.Test; import org.neo4j.driver.Record; import org.neo4j.driver.Session; +import org.testcontainers.containers.wait.strategy.Wait; import java.util.List; import java.util.Map; @@ -43,6 +44,7 @@ public static void beforeAll() throws InterruptedException { .withNeo4jConfig("metrics.enabled", "true") .withNeo4jConfig("metrics.csv.interval", "1s") .withNeo4jConfig("metrics.namespaces.enabled", "true"); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); session = neo4jContainer.getSession(); } diff --git a/extended-it/src/test/java/apoc/neo4j/docker/SystemDbEnterpriseTest.java b/extended-it/src/test/java/apoc/neo4j/docker/SystemDbEnterpriseTest.java index 2fd1d3170f..cbf87a4f58 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/SystemDbEnterpriseTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/SystemDbEnterpriseTest.java @@ -9,6 +9,7 @@ import org.junit.Test; import org.neo4j.driver.Session; import org.neo4j.driver.types.Node; +import org.testcontainers.containers.wait.strategy.Wait; import java.io.File; import java.io.IOException; @@ -54,7 +55,7 @@ public static void beforeClass() throws Exception { .withNeo4jConfig("dbms.security.keystore.path", pathPwdValue) .withNeo4jConfig("dbms.security.keystore.password", PASSWORD) .withNeo4jConfig("dbms.security.key.name", randomKeyAlias); - + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); session = neo4jContainer.getSession(); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/TTLMultiDbTest.java b/extended-it/src/test/java/apoc/neo4j/docker/TTLMultiDbTest.java index ce044e880c..f202bfc5b0 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/TTLMultiDbTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/TTLMultiDbTest.java @@ -9,6 +9,7 @@ import org.neo4j.driver.Record; import org.neo4j.driver.Session; import org.neo4j.driver.SessionConfig; +import org.testcontainers.containers.wait.strategy.Wait; import java.util.List; import java.util.Map; @@ -42,6 +43,7 @@ public static void setupContainer() { "apoc.ttl.schedule." + DB_FOO, "7", "apoc.ttl.limit", "200", "apoc.ttl.limit." + DB_BAR, "2000")); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); driver = neo4jContainer.getDriver(); createDatabases(); diff --git a/extended-it/src/test/java/apoc/neo4j/docker/UUIDMultiDbTest.java b/extended-it/src/test/java/apoc/neo4j/docker/UUIDMultiDbTest.java index 13099e46cf..73567b1f99 100644 --- a/extended-it/src/test/java/apoc/neo4j/docker/UUIDMultiDbTest.java +++ b/extended-it/src/test/java/apoc/neo4j/docker/UUIDMultiDbTest.java @@ -8,6 +8,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.neo4j.driver.*; +import org.testcontainers.containers.wait.strategy.Wait; import java.util.Collections; import java.util.Iterator; @@ -47,6 +48,7 @@ public static void setupContainer() { .withEnv(String.format(APOC_UUID_ENABLED_DB, DB_TEST), "false") .withEnv(APOC_UUID_ENABLED, "true") .withEnv(APOC_UUID_REFRESH, "1000"); + neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()); neo4jContainer.start(); driver = neo4jContainer.getDriver(); SYS_CONF = SessionConfig.forDatabase(SYSTEM_DATABASE_NAME);