From c9cb87b439ea723db929cc6a9a44bd09b6104f67 Mon Sep 17 00:00:00 2001 From: simonh5 Date: Fri, 13 Oct 2023 11:30:38 -0500 Subject: [PATCH] Fix flaky test assertions (#2640) in test TestResourceAssignmentOptimizerAccessor #testComputePartitionAssignment --- .../server/TestResourceAssignmentOptimizerAccessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAssignmentOptimizerAccessor.java b/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAssignmentOptimizerAccessor.java index aa1e4993e1c..16e9ad6ce54 100644 --- a/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAssignmentOptimizerAccessor.java +++ b/helix-rest/src/test/java/org/apache/helix/rest/server/TestResourceAssignmentOptimizerAccessor.java @@ -38,7 +38,9 @@ import org.apache.helix.model.IdealState; import org.apache.helix.model.InstanceConfig; import org.apache.helix.rest.server.resources.helix.ResourceAssignmentOptimizerAccessor; -import org.json.JSONException;import org.skyscreamer.jsonassert.JSONAssert;import org.testng.Assert; +import org.json.JSONException; +import org.skyscreamer.jsonassert.JSONAssert; +import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -141,7 +143,8 @@ public void testComputePartitionAssignment() throws IOException, JSONException { MultivaluedMap headers2 = response2.getHeaders(); Assert .assertTrue(headers2.containsKey(ResourceAssignmentOptimizerAccessor.RESPONSE_HEADER_KEY)); - List partitionAssignmentMetadata2 = headers2.get(ResourceAssignmentOptimizerAccessor.RESPONSE_HEADER_KEY); + List partitionAssignmentMetadata2 = + headers2.get(ResourceAssignmentOptimizerAccessor.RESPONSE_HEADER_KEY); Assert.assertFalse( headers2.get(ResourceAssignmentOptimizerAccessor.RESPONSE_HEADER_KEY).isEmpty()); JSONAssert.assertEquals("{instanceFilter=[" + liveInstances.get(0) + ", " + liveInstances.get(1) + "], "