From b9f8b916e70cc1d2c47067fe3ec9db4316a9b99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nadja=20M=C3=BCller?= <73830555+nadja-muller@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:40:50 +0200 Subject: [PATCH] [x2fDvuKu] extend timeout for flaky BigGraphTest (#504) increase timeout time for outliers and improve output for failing tests --- core/src/test/java/apoc/export/BigGraphTest.java | 2 +- .../src/main/java/apoc/util/TransactionTestUtil.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/apoc/export/BigGraphTest.java b/core/src/test/java/apoc/export/BigGraphTest.java index c7ec22384..73653e8c6 100644 --- a/core/src/test/java/apoc/export/BigGraphTest.java +++ b/core/src/test/java/apoc/export/BigGraphTest.java @@ -108,7 +108,7 @@ public void testTerminateRenameNodeProp() { @Test public void testTerminateRenameType() { - checkTerminationGuard(db, "CALL apoc.refactor.rename.type('DIRECTED', 'DIRECTED_TWO')"); + checkTerminationGuard(db, 50L, "CALL apoc.refactor.rename.type('DIRECTED', 'DIRECTED_TWO')"); } @Test diff --git a/test-utils/src/main/java/apoc/util/TransactionTestUtil.java b/test-utils/src/main/java/apoc/util/TransactionTestUtil.java index c4ce6419e..739589b7f 100644 --- a/test-utils/src/main/java/apoc/util/TransactionTestUtil.java +++ b/test-utils/src/main/java/apoc/util/TransactionTestUtil.java @@ -80,9 +80,11 @@ public static void lastTransactionChecks(GraphDatabaseService db, String query, } public static void checkTransactionTime(long timeout, long timePassed) { - timePassed = (System.currentTimeMillis() - timePassed) / 1000; - assertTrue("The transaction hasn't been terminated before the timeout time, but after " + timePassed + " seconds", - timePassed <= timeout); + double timePassedDouble = (System.currentTimeMillis() - timePassed) / 1000.0; + + assertTrue("The transaction hasn't been terminated before the given timeout time (" + timeout + + "), but after " + timePassedDouble + " seconds", + timePassedDouble <= timeout); } public static void checkTransactionNotInList(GraphDatabaseService db, String query) {