Skip to content

Commit 14510a9

Browse files
committed
Change sort order of shard stats in CCR test
This commit changes the sort order of shard stats that are collected in CCR retention lease integration tests. This change is done so that primaries appear first in sort order.
1 parent 91f69fc commit 14510a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ private List<ShardStats> getShardsStats(final IndicesStatsResponse stats) {
568568
return Arrays.stream(stats.getShards())
569569
.sorted((s, t) -> {
570570
if (s.getShardRouting().shardId().id() == t.getShardRouting().shardId().id()) {
571-
return Boolean.compare(s.getShardRouting().primary(), t.getShardRouting().primary());
571+
return -Boolean.compare(s.getShardRouting().primary(), t.getShardRouting().primary());
572572
} else {
573573
return Integer.compare(s.getShardRouting().shardId().id(), t.getShardRouting().shardId().id());
574574
}

0 commit comments

Comments
 (0)