Skip to content

Commit

Permalink
Fix flaky test (apache#2643)
Browse files Browse the repository at this point in the history
in org.apache.helix.rest.server.
TestResourceAccessor#testGetResources
  • Loading branch information
simonh5 committed Oct 13, 2023
1 parent 3216a09 commit e1050de
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ public void testGetResources() throws IOException {

Set<String> resources = OBJECT_MAPPER.readValue(idealStates,
OBJECT_MAPPER.getTypeFactory().constructCollectionType(Set.class, String.class));
Assert.assertEquals(resources.size(), _resourcesMap.get("TestCluster_0").size(), "Sizes are not equal");
Assert.assertTrue(resources.containsAll(_resourcesMap.get("TestCluster_0")), "resources does not contain all "
+ "elements from _resourcesMap");
Assert.assertTrue(_resourcesMap.get("TestCluster_0").containsAll(resources), "_resourcesMap does not contain all "
+ "elements from resources");
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. _resourcesMap.size(): "
+ _resourcesMap.size() + "; "
+ "_resourcesMap.get(TestCluster_0).size(): "
+ _resourcesMap.get("TestCluster_0").size() + "; "
+ "resources.containsAll(_resourcesMap.get(TestCluster_0)): "
+ resources.containsAll(_resourcesMap.get("TestCluster_0")) + "; "
+ "_resourcesMap.get(TestCluster_0).containsAll(resources): "
+ _resourcesMap.get("TestCluster_0").containsAll(resources));
System.out.println("End test :" + TestHelper.getTestMethodName());
}

Expand Down

0 comments on commit e1050de

Please sign in to comment.