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

xyuanlu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new c818b6f29  Stabilize TestCardDealingAdjustmentAlgorithmV2 - sequence 
all tests (#2597)
c818b6f29 is described below

commit c818b6f2987ebcfd41e43d5f1bc6bf8952a56c29
Author: xyuanlu <[email protected]>
AuthorDate: Tue Aug 22 14:52:54 2023 -0700

     Stabilize TestCardDealingAdjustmentAlgorithmV2 - sequence all tests (#2597)
---
 .../TestCardDealingAdjustmentAlgorithmV2.java      | 24 +++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git 
a/helix-core/src/test/java/org/apache/helix/controller/strategy/crushMapping/TestCardDealingAdjustmentAlgorithmV2.java
 
b/helix-core/src/test/java/org/apache/helix/controller/strategy/crushMapping/TestCardDealingAdjustmentAlgorithmV2.java
index 6d2fb1b0c..e4f0cad23 100644
--- 
a/helix-core/src/test/java/org/apache/helix/controller/strategy/crushMapping/TestCardDealingAdjustmentAlgorithmV2.java
+++ 
b/helix-core/src/test/java/org/apache/helix/controller/strategy/crushMapping/TestCardDealingAdjustmentAlgorithmV2.java
@@ -96,6 +96,7 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
 
   @Test(description = "Verify a few properties after algorithm object is 
created")
   public void testAlgorithmConstructor() {
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testAlgorithmConstructor");
     CardDealingAdjustmentAlgorithmV2Accessor algorithm =
         new CardDealingAdjustmentAlgorithmV2Accessor(_topology, 
DEFAULT_REPLICA_COUNT,
             CardDealingAdjustmentAlgorithmV2.Mode.EVENNESS);
@@ -141,6 +142,7 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
       Assert.assertEquals(instanceNodes.size(), NUM_INSTANCES_PER_ZONE);
       Assert.assertEquals(actualInstanceIds, expectedInstanceIds);
     }
+    System.out.println("END 
TestCardDealingAdjustmentAlgorithmV2.testAlgorithmConstructor");
   }
 
   @DataProvider
@@ -187,9 +189,11 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
     };
   }
 
-  @Test(description = "Compute mapping multiple times, the mapping of each 
time should be same", dataProvider = "stableComputingVerification")
+  @Test(description = "Compute mapping multiple times, the mapping of each 
time should be same", dataProvider = "stableComputingVerification",
+      dependsOnMethods = "testAlgorithmConstructor")
   public void testStableComputeMappingForMultipleTimes(int replica, int 
repeatTimes, int seed,
       boolean isEvennessPreferred) {
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testStableComputeMappingForMultipleTimes");
     CardDealingAdjustmentAlgorithmV2.Mode preference =
         isEvennessPreferred ? CardDealingAdjustmentAlgorithmV2.Mode.EVENNESS
             : CardDealingAdjustmentAlgorithmV2.Mode.MINIMIZE_MOVEMENT;
@@ -226,6 +230,7 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
       lastCalculatedDifference = newDifference;
       repeatTimes -= 1;
     }
+    System.out.println("END 
TestCardDealingAdjustmentAlgorithmV2.testStableComputeMappingForMultipleTimes");
   }
 
   @DataProvider
@@ -245,8 +250,9 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
     };
   }
 
-  @Test(description = "Test performance given different replica count", 
dataProvider = "replicas")
+  @Test(description = "Test performance given different replica count", 
dataProvider = "replicas",  dependsOnMethods = 
"testStableComputeMappingForMultipleTimes")
   public void testComputeMappingForDifferentReplicas(int replica) {
+    System.out.println("SATRT 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingForDifferentReplicas");
     CardDealingAdjustmentAlgorithmV2Accessor algorithm =
         new CardDealingAdjustmentAlgorithmV2Accessor(_topology, replica,
             CardDealingAdjustmentAlgorithmV2.Mode.EVENNESS);
@@ -273,10 +279,13 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
       Assert.fail(String.format("Total movements: %s != expected %s, replica: 
%s", totalMovements,
           expected.get(replica), replica));
     }
+    System.out.println("END 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingForDifferentReplicas");
+
   }
 
-  @Test(description = "Test performance given different preference (evenness 
or less movements)")
+  @Test(description = "Test performance given different preference (evenness 
or less movements)", dependsOnMethods = 
"testComputeMappingForDifferentReplicas")
   public void testComputeMappingForDifferentPreference() {
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingForDifferentPreference");
     CardDealingAdjustmentAlgorithmV2Accessor algorithm1 =
         new CardDealingAdjustmentAlgorithmV2Accessor(_topology, 
DEFAULT_REPLICA_COUNT,
             CardDealingAdjustmentAlgorithmV2.Mode.EVENNESS);
@@ -307,10 +316,12 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
     System.out.println(String.format("Total movements: %s, isAllAssigned: %s, 
preference: %s",
         movement2, isAllAssigned2, 
CardDealingAdjustmentAlgorithmV2.Mode.MINIMIZE_MOVEMENT));
     Assert.assertTrue(movement1 >= movement2);
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingForDifferentPreference");
   }
 
-  @Test
+  @Test (dependsOnMethods = "testComputeMappingForDifferentPreference")
   public void testComputeMappingWhenZeroWeightInstance() {
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingWhenZeroWeightInstance");
     when(_topology.getFaultZones()).thenReturn(createFaultZones(new int[][] {
         {
             0, 1
@@ -340,10 +351,12 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
     System.out.println("old mapping" + oldSimpleMapping);
     System.out.println("new mapping" + newSimpleMapping);
     Assert.assertTrue(newSimpleMapping.get(0L).isEmpty());
+    System.out.println("END 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingWhenZeroWeightInstance");
   }
 
-  @Test
+  @Test (dependsOnMethods = "testComputeMappingWhenZeroWeightInstance")
   public void testComputeMappingWhenZeroWeightZone() {
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingWhenZeroWeightZone");
     when(_topology.getFaultZones()).thenReturn(createFaultZones(new int[][] {
         {
             0
@@ -372,6 +385,7 @@ public class TestCardDealingAdjustmentAlgorithmV2 {
     System.out.println("old mapping" + oldSimpleMapping);
     System.out.println("new mapping" + newSimpleMapping);
     Assert.assertTrue(newSimpleMapping.get(0L).isEmpty());
+    System.out.println("START 
TestCardDealingAdjustmentAlgorithmV2.testComputeMappingWhenZeroWeightZone");
   }
 
   private int getTotalMovements(Map<Long, Set<String>> oldSimpleMapping,

Reply via email to