From 7e73d2b330ccef56bd2bb0852a3155145ed9118b Mon Sep 17 00:00:00 2001 From: Rob Rudin Date: Mon, 10 Apr 2023 17:06:38 -0400 Subject: [PATCH] GraphQL tests should only run on MarkLogic 11 Also tweaked AdjustQueryBatcher test based on intermittent failure on Jenkins. --- .../datamovement/AdjustQueryBatcherThreadCountTest.java | 9 +++++++-- .../java/com/marklogic/client/test/rows/GraphQLTest.java | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement/AdjustQueryBatcherThreadCountTest.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement/AdjustQueryBatcherThreadCountTest.java index 3ce0c9c9b..d4edbd231 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement/AdjustQueryBatcherThreadCountTest.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement/AdjustQueryBatcherThreadCountTest.java @@ -14,6 +14,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; public class AdjustQueryBatcherThreadCountTest extends AbstractFunctionalTest { @@ -40,8 +41,12 @@ void increaseThreadCount() { dmm.stopJob(qb); assertEquals(20, uriCount.get()); - assertEquals(3, threadNames.size(), "3 threads should have processed all the batches, as the thread count " + - "was increased from 1 to 3 100ms into the job."); + int threadNameCount = threadNames.size(); + assertTrue(threadNameCount == 3 || threadNameCount == 4, + "3 threads should have processed all the batches, as the thread count was increased from 1 to 3 100ms " + + "into the job. 4 thread names appears to be okay too; that has occurred when the test is run in " + + "Jenkins, and it may be due to 3 new thread names being created by the Java executor when the thread " + + "count is adjusted from 1 to 3."); } @Test diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/rows/GraphQLTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/rows/GraphQLTest.java index 3a949e161..f035baf51 100644 --- a/marklogic-client-api/src/test/java/com/marklogic/client/test/rows/GraphQLTest.java +++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/rows/GraphQLTest.java @@ -6,12 +6,15 @@ import com.marklogic.client.io.StringHandle; import com.marklogic.client.row.RowManager; import com.marklogic.client.test.Common; +import com.marklogic.client.test.junit5.RequiresML11; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(RequiresML11.class) public class GraphQLTest extends AbstractOpticUpdateTest { private final static String QUERY = "query myQuery { opticUnitTest_musician {firstName lastName}}";