Fix sequence number assertions in BWC tests
The assertions here on the expected sequence numbers were wrong, not
correctly taking into account the number of documents that had been
indexed. This commit fixes these assertions.
Relates
@@ -199,7 +199,7 @@ public class IndexingIT extends ESRestTestCase {
final int numberOfInitialDocs = 1 + randomInt(5);
logger.info("indexing [{}] docs initially", numberOfInitialDocs);
numDocs += indexDocs(index, 0, numberOfInitialDocs);
- assertSeqNoOnShards(index, nodes, 0, newNodeClient);
+ assertSeqNoOnShards(index, nodes, numDocs, newNodeClient);
logger.info("allowing shards on all nodes");
updateIndexSetting(index, Settings.builder().putNull("index.routing.allocation.include._name"));
ensureGreen();
@@ -210,7 +210,7 @@ public class IndexingIT extends ESRestTestCase {
final int numberOfDocsAfterAllowingShardsOnAllNodes = 1 + randomInt(5);
logger.info("indexing [{}] docs after allowing shards on all nodes", numberOfDocsAfterAllowingShardsOnAllNodes);
numDocs += indexDocs(index, numDocs, numberOfDocsAfterAllowingShardsOnAllNodes);
- assertSeqNoOnShards(index, nodes, 0, newNodeClient);
+ assertSeqNoOnShards(index, nodes, numDocs, newNodeClient);
Shard primary = buildShards(index, nodes, newNodeClient).stream().filter(Shard::isPrimary).findFirst().get();
logger.info("moving primary to new node by excluding {}", primary.getNode().getNodeName());
updateIndexSetting(index, Settings.builder().put("index.routing.allocation.exclude._name", primary.getNode().getNodeName()));
@@ -220,7 +220,7 @@ public class IndexingIT extends ESRestTestCase {
logger.info("indexing [{}] docs after moving primary", numberOfDocsAfterMovingPrimary);
numDocsOnNewPrimary += indexDocs(index, numDocs, numberOfDocsAfterMovingPrimary);
numDocs += numberOfDocsAfterMovingPrimary;
- assertSeqNoOnShards(index, nodes, numDocsOnNewPrimary, newNodeClient);
+ assertSeqNoOnShards(index, nodes, numDocs, newNodeClient);
/*
* Dropping the number of replicas to zero, and then increasing it to one triggers a recovery thus exercising any BWC-logic in
* the recovery code.
@@ -238,7 +238,7 @@ public class IndexingIT extends ESRestTestCase {
// the number of documents on the primary and on the recovered replica should match the number of indexed documents
assertCount(index, "_primary", numDocs);
assertCount(index, "_replica", numDocs);
- assertSeqNoOnShards(index, nodes, numDocsOnNewPrimary, newNodeClient);
+ assertSeqNoOnShards(index, nodes, numDocs, newNodeClient);
}
}
