Skip to content

Commit

Permalink
try fixing codeartifact docker timeout exception
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Sep 2, 2024
1 parent c01b76c commit 716388c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("'", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 2 additions & 0 deletions extended-it/src/test/java/apoc/neo4j/docker/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 716388c

Please sign in to comment.