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 5, 2023
1 parent 6241bcb commit 3216a09
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ public void testGetResources() throws IOException {

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.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");
System.out.println("End test :" + TestHelper.getTestMethodName());
}

Expand Down

0 comments on commit 3216a09

Please sign in to comment.