From 1a67d6207d835afb46b001a9f731818fb9663ab2 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:52:03 -0400 Subject: [PATCH] Disable Cosmos unit parallelization to investigate flakiness (#41331) Disable Cosmos unit parallelization to investigate flakiness --- .../java/com/azure/cosmos/encryption/TestSuiteBase.java | 6 +++--- .../com/azure/cosmos/implementation/TestSuiteBase.java | 7 +++---- .../src/test/java/com/azure/cosmos/rx/TestSuiteBase.java | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/TestSuiteBase.java b/sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/TestSuiteBase.java index 05fbcca73d880..c44b96f5ab256 100644 --- a/sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/TestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/TestSuiteBase.java @@ -66,7 +66,6 @@ import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import org.testng.annotations.Listeners; -import org.testng.xml.XmlSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; @@ -263,8 +262,9 @@ public static void beforeSuite() { @BeforeSuite(groups = {"unit"}) public static void parallelizeUnitTests(ITestContext context) { - context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); - context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); + // TODO: Parallelization was disabled due to flaky tests. Re-enable after fixing the flaky tests. +// context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); +// context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); } @AfterSuite(groups = {"fast", "long", "direct", "multi-master", "encryption"}, timeOut = SUITE_SHUTDOWN_TIMEOUT) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java index 6930aab6d800c..cb72a7099633e 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java @@ -5,7 +5,6 @@ import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.CosmosAsyncClient; import com.azure.cosmos.CosmosClientBuilder; -import com.azure.cosmos.CosmosException; import com.azure.cosmos.DirectConnectionConfig; import com.azure.cosmos.DocumentClientTest; import com.azure.cosmos.GatewayConnectionConfig; @@ -43,7 +42,6 @@ import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import org.testng.annotations.Listeners; -import org.testng.xml.XmlSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; @@ -164,8 +162,9 @@ public static void beforeSuite() { @BeforeSuite(groups = {"unit"}) public static void parallelizeUnitTests(ITestContext context) { - context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); - context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); + // TODO: Parallelization was disabled due to flaky tests. Re-enable after fixing the flaky tests. +// context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); +// context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); } @AfterSuite(groups = {"fast", "long", "direct", "multi-region", "multi-master", "flaky-multi-master", "emulator", "split", "query", "cfp-split"}, timeOut = SUITE_SHUTDOWN_TIMEOUT) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java index ee7ad051eb78d..4d5d330560817 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java @@ -74,7 +74,6 @@ import org.testng.annotations.BeforeSuite; import org.testng.annotations.DataProvider; import org.testng.annotations.Listeners; -import org.testng.xml.XmlSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; @@ -222,8 +221,9 @@ public void beforeSuite() { @BeforeSuite(groups = {"unit"}) public static void parallelizeUnitTests(ITestContext context) { - context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); - context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); + // TODO: Parallelization was disabled due to flaky tests. Re-enable after fixing the flaky tests. +// context.getSuite().getXmlSuite().setParallel(XmlSuite.ParallelMode.CLASSES); +// context.getSuite().getXmlSuite().setThreadCount(Runtime.getRuntime().availableProcessors()); } @AfterSuite(groups = {"fast", "long", "direct", "multi-region", "multi-master", "flaky-multi-master", "emulator", "split", "query", "cfp-split", "circuit-breaker-misc-gateway", "circuit-breaker-misc-direct", "circuit-breaker-read-all-read-many"}, timeOut = SUITE_SHUTDOWN_TIMEOUT)