You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ji...@apache.org on 2021/08/31 20:00:42 UTC

[helix] branch revert-1853-master created (now cda7c02)

This is an automated email from the ASF dual-hosted git repository.

jiajunwang pushed a change to branch revert-1853-master
in repository https://gitbox.apache.org/repos/asf/helix.git.


      at cda7c02  Revert "Improve TestControllerLeadershipChange test logic to tolerate longer delay when test runs. (#1853)"

This branch includes the following new commits:

     new cda7c02  Revert "Improve TestControllerLeadershipChange test logic to tolerate longer delay when test runs. (#1853)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[helix] 01/01: Revert "Improve TestControllerLeadershipChange test logic to tolerate longer delay when test runs. (#1853)"

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jiajunwang pushed a commit to branch revert-1853-master
in repository https://gitbox.apache.org/repos/asf/helix.git

commit cda7c02ede61968185841d9e12d46c1206f5f953
Author: Jiajun Wang <jj...@linkedin.com>
AuthorDate: Tue Aug 31 13:00:38 2021 -0700

    Revert "Improve TestControllerLeadershipChange test logic to tolerate longer delay when test runs. (#1853)"
    
    This reverts commit a570d0566c42942b6154cb84a3d44f864fde37f0.
---
 .../controller/TestControllerLeadershipChange.java      | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/helix-core/src/test/java/org/apache/helix/integration/controller/TestControllerLeadershipChange.java b/helix-core/src/test/java/org/apache/helix/integration/controller/TestControllerLeadershipChange.java
index 379feb9..1de1296 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/controller/TestControllerLeadershipChange.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/controller/TestControllerLeadershipChange.java
@@ -189,7 +189,6 @@ public class TestControllerLeadershipChange extends ZkTestBase {
     String resourceName = "testResource";
     int numPartition = 1;
     int numReplica = 1;
-    int simulatedTransitionDelayMs = 100;
     String stateModel = "LeaderStandby";
     ObjectName resourceMBeanObjectName = getResourceMonitorObjectName(clusterName, resourceName);
     MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
@@ -206,7 +205,7 @@ public class TestControllerLeadershipChange extends ZkTestBase {
     // Create participant
     _gSetupTool.addInstanceToCluster(clusterName, instanceName);
     MockParticipantManager participant =
-        new MockParticipantManager(ZK_ADDR, clusterName, instanceName, simulatedTransitionDelayMs);
+        new MockParticipantManager(ZK_ADDR, clusterName, instanceName);
     participant.syncStart();
 
     // Create controller, since this is the only controller, it will be the leader
@@ -247,9 +246,6 @@ public class TestControllerLeadershipChange extends ZkTestBase {
     Assert.assertTrue(clusterVerifier.verify());
 
     Thread.sleep(1000);
-
-    // The moment before manager1 regain leadership. The topstateless duration will start counting.
-    long start = System.currentTimeMillis();
     setLeader(manager1);
 
     Assert.assertTrue(manager1.isLeader());
@@ -262,19 +258,12 @@ public class TestControllerLeadershipChange extends ZkTestBase {
     _gSetupTool.rebalanceResource(clusterName, resourceName, numReplica);
 
     Assert.assertTrue(clusterVerifier.verifyByPolling());
-    // The moment that partition top state has been recovered. The topstateless duration stopped counting.
-    long end = System.currentTimeMillis();
 
     // Resource lost top state, and manager1 lost leadership for 2000ms, because manager1 will
     // clean monitoring cache after re-gaining leadership, so max value of hand off duration should
     // not have such a large value
-    long duration = (long) beanServer
-        .getAttribute(resourceMBeanObjectName, "PartitionTopStateHandoffDurationGauge.Max");
-    long controllerOpDuration = end - start;
-    Assert.assertTrue(duration >= simulatedTransitionDelayMs && duration <= controllerOpDuration,
-        String.format(
-            "The recorded TopState-less duration is %d. But the controller operation duration is %d.",
-            duration, controllerOpDuration));
+    Assert.assertTrue((long) beanServer
+        .getAttribute(resourceMBeanObjectName, "PartitionTopStateHandoffDurationGauge.Max") < 500);
 
     participant.syncStop();
     manager1.disconnect();