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

jxue 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 6011a90b7 Fix test due to wrong assumption that cluster 0 only has 
semi auto resources
6011a90b7 is described below

commit 6011a90b7e55caedda8ec218f425a8d98aa03ead
Author: Junkai Xue <[email protected]>
AuthorDate: Wed Jul 17 16:25:31 2024 -0700

    Fix test due to wrong assumption that cluster 0 only has semi auto resources
---
 .../org/apache/helix/rest/server/TestPerInstanceAccessor.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
index e3f0dcd6c..58dbb78ea 100644
--- 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
+++ 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java
@@ -56,7 +56,7 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 
 public class TestPerInstanceAccessor extends AbstractTestClass {
-  private final static String CLUSTER_NAME = "TestCluster_0";
+  private final static String CLUSTER_NAME = "TestCluster_4";
   private final static String INSTANCE_NAME = CLUSTER_NAME + "localhost_12918";
 
   @Test
@@ -256,7 +256,8 @@ public class TestPerInstanceAccessor extends 
AbstractTestClass {
   @Test(dependsOnMethods = "testTakeInstanceCheckOnly")
   public void testGetAllMessages() throws IOException {
     System.out.println("Start test :" + TestHelper.getTestMethodName());
-    String testInstance = CLUSTER_NAME + "localhost_12926"; //Non-live instance
+    _mockParticipantManagers.get(0).disconnect();
+    String testInstance = CLUSTER_NAME + "localhost_12918"; //Non-live instance
 
     String messageId = "msg1";
     Message message = new Message(Message.MessageType.STATE_TRANSITION, 
messageId);
@@ -280,10 +281,10 @@ public class TestPerInstanceAccessor extends 
AbstractTestClass {
   }
 
   @Test(dependsOnMethods = "testGetAllMessages")
-  public void testGetMessagesByStateModelDef() throws IOException {
+  public void testGetMessagesByStateModelDef() throws Exception {
     System.out.println("Start test :" + TestHelper.getTestMethodName());
 
-    String testInstance = CLUSTER_NAME + "localhost_12926"; //Non-live instance
+    String testInstance = CLUSTER_NAME + "localhost_12918"; //Non-live instance
     String messageId = "msg1";
     Message message = new Message(Message.MessageType.STATE_TRANSITION, 
messageId);
     message.setStateModelDef("MasterSlave");
@@ -314,6 +315,7 @@ public class TestPerInstanceAccessor extends 
AbstractTestClass {
         
node.get(PerInstanceAccessor.PerInstanceProperties.total_message_count.name()).intValue();
 
     Assert.assertEquals(newMessageCount, 0);
+    _mockParticipantManagers.get(0).connect();
     System.out.println("End test :" + TestHelper.getTestMethodName());
   }
 

Reply via email to