diff --git a/core/src/test/java/apoc/trigger/TriggerClusterRoutingTest.java b/core/src/test/java/apoc/trigger/TriggerClusterRoutingTest.java index 102889c9e..657c10289 100644 --- a/core/src/test/java/apoc/trigger/TriggerClusterRoutingTest.java +++ b/core/src/test/java/apoc/trigger/TriggerClusterRoutingTest.java @@ -18,6 +18,7 @@ import static apoc.trigger.Trigger.SYS_NON_WRITER_ERROR; import static apoc.trigger.TriggerNewProcedures.TRIGGER_NOT_ROUTED_ERROR; +import static apoc.util.TestContainerUtil.testCall; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -87,11 +88,15 @@ private static void triggerInSysLeaderMemberCommon(String query, String triggerN Session session = driver.session(SessionConfig.forDatabase(dbName)); final String address = container.getEnvMap().get("NEO4J_dbms_connector_bolt_advertised__address"); if (dbIsWriter(session, dbName, address)) { - session.run(query, Map.of("name", UUID.randomUUID().toString())).consume(); + final String name = UUID.randomUUID().toString(); + testCall( session, query, + Map.of("name", name), + row -> assertEquals(name, row.get("name")) ); } else { try { - session.run(query, Map.of("name", UUID.randomUUID().toString())).consume(); - fail("Should fail because of non writer trigger addition"); + testCall(session, query, + Map.of("name", UUID.randomUUID().toString()), + row -> fail("Should fail because of non writer trigger addition")); } catch (Exception e) { String errorMsg = e.getMessage(); assertTrue("The actual message is: " + errorMsg, errorMsg.contains(triggerNotRoutedError)); diff --git a/core/src/test/java/apoc/trigger/TriggerTestUtil.java b/core/src/test/java/apoc/trigger/TriggerTestUtil.java index 55d046238..acb22397c 100644 --- a/core/src/test/java/apoc/trigger/TriggerTestUtil.java +++ b/core/src/test/java/apoc/trigger/TriggerTestUtil.java @@ -8,7 +8,7 @@ import static org.junit.Assert.assertEquals; public class TriggerTestUtil { - public static final long TIMEOUT = 10L; + public static final long TIMEOUT = 30L; public static void awaitTriggerDiscovered(GraphDatabaseService db, String name, String query) { awaitTriggerDiscovered(db, name, query, false); diff --git a/full/src/test/java/apoc/trigger/TriggerNewProceduresExtendedTest.java b/full/src/test/java/apoc/trigger/TriggerNewProceduresExtendedTest.java index c46f070a5..5a91b634c 100644 --- a/full/src/test/java/apoc/trigger/TriggerNewProceduresExtendedTest.java +++ b/full/src/test/java/apoc/trigger/TriggerNewProceduresExtendedTest.java @@ -33,7 +33,7 @@ import static org.neo4j.configuration.GraphDatabaseSettings.procedure_unrestricted; public class TriggerNewProceduresExtendedTest { - private static final long TIMEOUT = 10L; + private static final long TIMEOUT = 30L; private static final File directory = new File("target/conf"); static { //noinspection ResultOfMethodCallIgnored