diff --git a/.github/workflows/Helix-Manual-CI.yml b/.github/workflows/Helix-Manual-CI.yml index 1d90abe9fc..aa381b4b94 100644 --- a/.github/workflows/Helix-Manual-CI.yml +++ b/.github/workflows/Helix-Manual-CI.yml @@ -37,13 +37,12 @@ jobs: - name: Run All Tests run: mvn -B -V -e -ntp "-Dstyle.color=always" ${{ github.event.inputs.mvnOpts }} ${{ github.event.inputs.goals }} - name: Test Report - uses: mikepenz/action-junit-report@v3 + uses: dorny/test-reporter@v1 if: always() with: name: Tests Results - path: './**/target/surefire-reports/junitreports/TEST-*.xml' - include_passed: true - detailed_summary: true + path: './**/target/surefire-reports/TEST-TestSuite.xml' + reporter: java-junit - name: Upload unit test results if: failure() uses: actions/upload-artifact@v2 diff --git a/helix-core/src/test/java/org/apache/helix/TestHierarchicalDataStore.java b/helix-core/src/test/java/org/apache/helix/TestHierarchicalDataStore.java index e46db137b5..808e488cc1 100644 --- a/helix-core/src/test/java/org/apache/helix/TestHierarchicalDataStore.java +++ b/helix-core/src/test/java/org/apache/helix/TestHierarchicalDataStore.java @@ -23,6 +23,7 @@ import org.apache.helix.controller.HierarchicalDataHolder; import org.apache.helix.zookeeper.api.client.HelixZkClient; +import org.apache.helix.zookeeper.impl.factory.SharedZkClientFactory; import org.testng.AssertJUnit; import org.testng.annotations.Test; @@ -32,8 +33,9 @@ public class TestHierarchicalDataStore extends ZkUnitTestBase { @Test(groups = { "unitTest" }) - public void testHierarchicalDataStore() throws InterruptedException { - _zkClient = TestHelper.createZkClient(ZK_ADDR); + public void testHierarchicalDataStore() { + _zkClient = SharedZkClientFactory.getInstance() + .buildZkClient(new HelixZkClient.ZkConnectionConfig(ZK_ADDR)); String path = "/tmp/testHierarchicalDataStore"; FileFilter filter = null; diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java index 0066f4b6e9..4e5c0da482 100644 --- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java +++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestRebalancePipeline.java @@ -19,7 +19,6 @@ * under the License. */ -import java.time.Duration; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -53,8 +52,6 @@ import org.testng.annotations.Test; public class TestRebalancePipeline extends ZkUnitTestBase { - - private static final Long MSG_PURGE_DELAY = Duration.ofSeconds(1).toMillis(); private final String _className = getShortClassName(); @Test @@ -198,6 +195,8 @@ public void testMsgTriggeredRebalance() throws Exception { 0, 1 }); + long msgPurgeDelay = MessageGenerationPhase.DEFAULT_OBSELETE_MSG_PURGE_DELAY; + ClusterControllerManager controller = new ClusterControllerManager(ZK_ADDR, clusterName, "controller_0"); controller.syncStart(); @@ -225,6 +224,7 @@ public void testMsgTriggeredRebalance() throws Exception { "SLAVE", true); // Controller has timeout > 1sec, so within 1s, controller should not have GCed message + Assert.assertTrue(msgPurgeDelay > 1000); Assert.assertFalse(TestHelper.verify(() -> { for (LiveInstance liveInstance : liveInstances) { List messages = @@ -237,7 +237,7 @@ public void testMsgTriggeredRebalance() throws Exception { }, TestHelper.WAIT_DURATION)); // After another purge delay, controller should cleanup messages and continue to rebalance - Thread.sleep(MSG_PURGE_DELAY); + Thread.sleep(msgPurgeDelay); // Manually trigger another rebalance by touching current state List allMsgs = new ArrayList<>(); setCurrentState(clusterName, "localhost_0", resourceName, resourceName + "_0", @@ -259,6 +259,7 @@ public void testMsgTriggeredRebalance() throws Exception { // controller will clean it up setCurrentState(clusterName, "localhost_0", resourceName, resourceName + "_0", liveInstances.get(0).getEphemeralOwner(), "MASTER", true); + Thread.sleep(msgPurgeDelay); // touch current state to trigger rebalance setCurrentState(clusterName, "localhost_0", resourceName, resourceName + "_0", liveInstances.get(0).getEphemeralOwner(), "MASTER", false); diff --git a/helix-core/src/test/java/org/apache/helix/tools/TestClusterStateVerifier.java b/helix-core/src/test/java/org/apache/helix/tools/TestClusterStateVerifier.java index 0dccc69fc1..8b342e81ef 100644 --- a/helix-core/src/test/java/org/apache/helix/tools/TestClusterStateVerifier.java +++ b/helix-core/src/test/java/org/apache/helix/tools/TestClusterStateVerifier.java @@ -19,6 +19,7 @@ * under the License. */ +import java.time.Duration; import java.util.Arrays; import com.google.common.collect.Sets; @@ -113,6 +114,7 @@ public void testEntireCluster() { public void testResourceSubset() { // Ensure that this passes even when one resource is down _admin.enableInstance(_clusterName, "localhost_12918", false); + TestHelper.sleepQuietly(Duration.ofMillis(1000)); _admin.enableCluster(_clusterName, false); _admin.enableInstance(_clusterName, "localhost_12918", true); BestPossAndExtViewZkVerifier verifier = new BestPossAndExtViewZkVerifier(ZK_ADDR,