diff options
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java')
-rw-r--r-- | clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java index f0b91102e8f..ec6255fd13b 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java @@ -10,8 +10,8 @@ import com.yahoo.vdslib.state.State; import com.yahoo.vespa.clustercontroller.core.database.DatabaseHandler; import com.yahoo.vespa.clustercontroller.core.database.ZooKeeperDatabaseFactory; import com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashSet; @@ -22,10 +22,10 @@ import java.util.Set; import static com.yahoo.vespa.clustercontroller.core.FeedBlockUtil.mapOf; import static com.yahoo.vespa.clustercontroller.core.FeedBlockUtil.setOf; import static com.yahoo.vespa.clustercontroller.core.FeedBlockUtil.usage; +import static org.junit.jupiter.api.Assertions.assertEquals; import static com.yahoo.vespa.clustercontroller.core.FeedBlockUtil.createResourceUsageJson; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ClusterFeedBlockTest extends FleetControllerTest { @@ -36,7 +36,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { private FleetController ctrl; private DummyCommunicator communicator; - @Before + @BeforeEach public void setUp() { supervisor = new Supervisor(new Transport()); } @@ -107,7 +107,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { } @Test - public void cluster_feed_can_be_blocked_and_unblocked_by_single_node() throws Exception { + void cluster_feed_can_be_blocked_and_unblocked_by_single_node() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)))); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); @@ -127,7 +127,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { } @Test - public void cluster_feed_block_state_is_recomputed_when_options_are_updated() throws Exception { + void cluster_feed_block_state_is_recomputed_when_options_are_updated() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)))); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); @@ -142,7 +142,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { } @Test - public void cluster_feed_block_state_is_recomputed_when_resource_block_set_differs() throws Exception { + void cluster_feed_block_state_is_recomputed_when_resource_block_set_differs() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)))); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); @@ -155,12 +155,12 @@ public class ClusterFeedBlockTest extends FleetControllerTest { bundle = ctrl.getClusterStateBundle(); assertTrue(bundle.clusterFeedIsBlocked()); assertEquals("cheese on node 1 [unknown hostname] (0.800 > 0.700), " + - "wine on node 1 [unknown hostname] (0.500 > 0.400)", - bundle.getFeedBlock().get().getDescription()); + "wine on node 1 [unknown hostname] (0.500 > 0.400)", + bundle.getFeedBlock().get().getDescription()); } @Test - public void cluster_feed_block_state_is_not_recomputed_when_only_resource_usage_levels_differ() throws Exception { + void cluster_feed_block_state_is_not_recomputed_when_only_resource_usage_levels_differ() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)))); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); @@ -177,7 +177,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { } @Test - public void cluster_feed_block_state_is_recomputed_when_usage_enters_hysteresis_range() throws Exception { + void cluster_feed_block_state_is_recomputed_when_usage_enters_hysteresis_range() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)), 0.1)); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); @@ -193,22 +193,22 @@ public class ClusterFeedBlockTest extends FleetControllerTest { // is not discovered here. Still correct in terms of what resources are blocked or not, but // the description is not up to date here. assertEquals("cheese on node 1 [unknown hostname] (0.750 > 0.700)", - bundle.getFeedBlock().get().getDescription()); + bundle.getFeedBlock().get().getDescription()); // Trigger an explicit recompute by adding a separate resource exhaustion reportResourceUsageFromNode(1, setOf(usage("cheese", 0.67), usage("wine", 0.5))); bundle = ctrl.getClusterStateBundle(); assertTrue(bundle.clusterFeedIsBlocked()); assertEquals("cheese on node 1 [unknown hostname] (0.670 > 0.600), " + - "wine on node 1 [unknown hostname] (0.500 > 0.400)", // Not under hysteresis - bundle.getFeedBlock().get().getDescription()); + "wine on node 1 [unknown hostname] (0.500 > 0.400)", // Not under hysteresis + bundle.getFeedBlock().get().getDescription()); // Wine usage drops beyond hysteresis range, should be unblocked immediately. reportResourceUsageFromNode(1, setOf(usage("cheese", 0.61), usage("wine", 0.2))); bundle = ctrl.getClusterStateBundle(); assertTrue(bundle.clusterFeedIsBlocked()); assertEquals("cheese on node 1 [unknown hostname] (0.610 > 0.600)", - bundle.getFeedBlock().get().getDescription()); + bundle.getFeedBlock().get().getDescription()); // Cheese now drops below hysteresis range, should be unblocked as well. reportResourceUsageFromNode(1, setOf(usage("cheese", 0.59), usage("wine", 0.2))); @@ -217,7 +217,7 @@ public class ClusterFeedBlockTest extends FleetControllerTest { } @Test - public void unavailable_nodes_are_not_considered_when_computing_feed_blocked_state() throws Exception { + void unavailable_nodes_are_not_considered_when_computing_feed_blocked_state() throws Exception { initialize(createOptions(mapOf(usage("cheese", 0.7), usage("wine", 0.4)), 0.1)); assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked()); |