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() {
396
396
// Verify that each shard has write-load reported.
397
397
final ClusterState state = getInstanceFromNode (ClusterService .class ).state ();
398
398
assertEquals (state .projectState (ProjectId .DEFAULT ).metadata ().getTotalNumberOfShards (), shardWriteLoads .size ());
399
- double maximumLoadRecorded = 0 ;
400
399
for (IndexMetadata indexMetadata : state .projectState (ProjectId .DEFAULT ).metadata ()) {
400
+ double maximumLoadRecorded = 0 ;
401
401
for (int i = 0 ; i < indexMetadata .getNumberOfShards (); i ++) {
402
402
final ShardId shardId = new ShardId (indexMetadata .getIndex (), i );
403
403
assertTrue (shardWriteLoads .containsKey (shardId ));
404
404
maximumLoadRecorded = Math .max (shardWriteLoads .get (shardId ), maximumLoadRecorded );
405
405
}
406
+ // Each index should have seen some write-load
407
+ assertThat (maximumLoadRecorded , greaterThan (0.0 ));
406
408
}
407
- // And that at least one is greater than zero
408
- assertThat (maximumLoadRecorded , greaterThan (0.0 ));
409
409
} finally {
410
410
updateClusterSettings (
411
411
Settings .builder ().putNull (WriteLoadConstraintSettings .WRITE_LOAD_DECIDER_ENABLED_SETTING .getKey ()).build ()
You can’t perform that action at this time.
0 commit comments