From a5d25cf2dd3f12bb8f1256f439906c03d6717578 Mon Sep 17 00:00:00 2001 From: simonh5 Date: Tue, 3 Oct 2023 00:12:29 -0500 Subject: [PATCH] Fix flaky test (#2643) in org.apache.helix.rest.server. TestResourceAccessor#testGetResources --- .../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 ce11b2f1b9..32002b5539 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 void testGetResources() throws IOException { Set 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()); }