From 1eea2538859c2ba572eeb2f51cd94ab91bea61bd Mon Sep 17 00:00:00 2001 From: Simon Hofbauer <61789910+hofi1@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:32:39 +0100 Subject: [PATCH] Fix flaky test (#2643) (#2664) in org.apache.helix.rest.server. TestResourceAccessor#testGetResources Co-authored-by: simonh5 --- .../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 683bc0b1cc..2bb91d416c 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()); }