diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java index 9b3eaa7de55..1cebb7dd2be 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java @@ -188,6 +188,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final RetentionLease retentionLease = @@ -311,6 +312,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final ClusterStateResponse followerIndexClusterState = @@ -349,6 +351,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { if (shardsStats.get(i).getShardRouting().primary() == false) { continue; } + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final ClusterStateResponse followerIndexClusterState = @@ -600,6 +603,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final RetentionLease retentionLease = @@ -663,6 +667,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final ClusterStateResponse followerIndexClusterState = @@ -701,6 +706,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { if (shardsStats.get(i).getShardRouting().primary() == false) { continue; } + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final ClusterStateResponse followerIndexClusterState = @@ -916,6 +922,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { leaderClient().admin().indices().stats(new IndicesStatsRequest().clear().indices(leaderIndex)).actionGet(); final List afterUnfollowShardsStats = getShardsStats(afterUnfollowStats); for (final ShardStats shardStats : afterUnfollowShardsStats) { + assertNotNull(shardStats.getRetentionLeaseStats()); assertThat(Strings.toString(shardStats), shardStats.getRetentionLeaseStats().retentionLeases().leases(), empty()); } } finally { @@ -966,6 +973,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { leaderClient().admin().indices().stats(new IndicesStatsRequest().clear().indices(leaderIndex)).actionGet(); final List afterForgetFollowerShardsStats = getShardsStats(afterForgetFollowerStats); for (final ShardStats shardStats : afterForgetFollowerShardsStats) { + assertNotNull(shardStats.getRetentionLeaseStats()); assertThat(Strings.toString(shardStats), shardStats.getRetentionLeaseStats().retentionLeases().leases(), empty()); } } @@ -985,6 +993,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final RetentionLease retentionLease = @@ -1002,6 +1011,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase { assertThat(stats.getShards(), arrayWithSize(numberOfShards * (1 + numberOfReplicas))); final List shardsStats = getShardsStats(stats); for (int i = 0; i < numberOfShards * (1 + numberOfReplicas); i++) { + assertNotNull(shardsStats.get(i).getRetentionLeaseStats()); final RetentionLeases currentRetentionLeases = shardsStats.get(i).getRetentionLeaseStats().retentionLeases(); assertThat(Strings.toString(shardsStats.get(i)), currentRetentionLeases.leases(), hasSize(1)); final RetentionLease retentionLease =