File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
server/src/internalClusterTest/java/org/elasticsearch/index/shard Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -396,16 +396,16 @@ public void testShardWriteLoadsArePresent() {
396396 // Verify that each shard has write-load reported.
397397 final ClusterState state = getInstanceFromNode (ClusterService .class ).state ();
398398 assertEquals (state .projectState (ProjectId .DEFAULT ).metadata ().getTotalNumberOfShards (), shardWriteLoads .size ());
399- double maximumLoadRecorded = 0 ;
400399 for (IndexMetadata indexMetadata : state .projectState (ProjectId .DEFAULT ).metadata ()) {
400+ double maximumLoadRecorded = 0 ;
401401 for (int i = 0 ; i < indexMetadata .getNumberOfShards (); i ++) {
402402 final ShardId shardId = new ShardId (indexMetadata .getIndex (), i );
403403 assertTrue (shardWriteLoads .containsKey (shardId ));
404404 maximumLoadRecorded = Math .max (shardWriteLoads .get (shardId ), maximumLoadRecorded );
405405 }
406+ // Each index should have seen some write-load
407+ assertThat (maximumLoadRecorded , greaterThan (0.0 ));
406408 }
407- // And that at least one is greater than zero
408- assertThat (maximumLoadRecorded , greaterThan (0.0 ));
409409 } finally {
410410 updateClusterSettings (
411411 Settings .builder ().putNull (WriteLoadConstraintSettings .WRITE_LOAD_DECIDER_ENABLED_SETTING .getKey ()).build ()
You can’t perform that action at this time.
0 commit comments