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 1eea25388 Fix flaky test (#2643) (#2664)
1eea25388 is described below

commit 1eea2538859c2ba572eeb2f51cd94ab91bea61bd
Author: Simon Hofbauer <[email protected]>
AuthorDate: Tue Feb 27 18:32:39 2024 +0100

    Fix flaky test (#2643) (#2664)
    
    in org.apache.helix.rest.server.
    TestResourceAccessor#testGetResources
    
    Co-authored-by: simonh5 <[email protected]>
---
 .../java/org/apache/helix/rest/server/TestResourceAccessor.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAccessor.java
 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAccessor.java
index 683bc0b1c..2bb91d416 100644
--- 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAccessor.java
+++ 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAccessor.java
@@ -75,8 +75,10 @@ public class TestResourceAccessor extends AbstractTestClass {
 
     Set<String> resources = OBJECT_MAPPER.readValue(idealStates,
         OBJECT_MAPPER.getTypeFactory().constructCollectionType(Set.class, 
String.class));
-    Assert.assertEquals(resources, _resourcesMap.get("TestCluster_0"), 
"Resources from response: "
-        + resources + " vs clusters actually: " + 
_resourcesMap.get("TestCluster_0"));
+    Assert.assertTrue(resources.size() == 
_resourcesMap.get("TestCluster_0").size()
+        && resources.containsAll(_resourcesMap.get("TestCluster_0"))
+        && _resourcesMap.get("TestCluster_0").containsAll(resources),
+        "Sets are not equal. Resources from response: " + resources + " vs 
clusters actually: " + _resourcesMap.get("TestCluster_0"));
     System.out.println("End test :" + TestHelper.getTestMethodName());
   }
 

Reply via email to