TEST: Skip assertSeqNos for closed shards (#33130)
If a shard was closed, we return null for SeqNoStats. Therefore the assertion assertSeqNos will hit NPE when it verifies a closed shard. This commit skips closed shards in assertSeqNos and enables this assertion in AbstractDisruptionTestCase.
This commit is contained in:
parent
739a8d3d44
commit
9dad82ece8
|
@ -109,6 +109,7 @@ public abstract class AbstractDisruptionTestCase extends ESIntegTestCase {
|
|||
protected void beforeIndexDeletion() throws Exception {
|
||||
if (disableBeforeIndexDeletion == false) {
|
||||
super.beforeIndexDeletion();
|
||||
assertSeqNos();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2349,6 +2349,9 @@ public abstract class ESIntegTestCase extends ESTestCase {
|
|||
final ObjectLongMap<String> globalCheckpoints = indexShard.getInSyncGlobalCheckpoints();
|
||||
for (ShardStats shardStats : indexShardStats) {
|
||||
final SeqNoStats seqNoStats = shardStats.getSeqNoStats();
|
||||
if (seqNoStats == null) {
|
||||
continue; // this shard was closed
|
||||
}
|
||||
assertThat(shardStats.getShardRouting() + " local checkpoint mismatch",
|
||||
seqNoStats.getLocalCheckpoint(), equalTo(primarySeqNoStats.getLocalCheckpoint()));
|
||||
assertThat(shardStats.getShardRouting() + " global checkpoint mismatch",
|
||||
|
|
Loading…
Reference in New Issue