Fix internal engine sequence number test bug

This commit fixes a test bug in internal engine tests, and adds some
additional assertions.
This commit is contained in:
Jason Tedor 2016-11-15 08:34:54 -05:00
parent c9f49039d3
commit ee722d738a
1 changed files with 7 additions and 2 deletions

View File

@ -1641,10 +1641,12 @@ public class InternalEngineTests extends ESTestCase {
final Engine.DeleteResult result = initialEngine.delete(delete);
if (!result.hasFailure()) {
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));
assertThat(initialEngine.seqNoService().getMaxSeqNo(), equalTo(primarySeqNo + 1));
indexedIds.remove(id);
primarySeqNo++;
} else {
assertThat(result.getSeqNo(), equalTo(primarySeqNo));
assertThat(result.getSeqNo(), equalTo(SequenceNumbersService.UNASSIGNED_SEQ_NO));
assertThat(initialEngine.seqNoService().getMaxSeqNo(), equalTo(primarySeqNo));
}
} else {
// index a document
@ -1657,9 +1659,12 @@ public class InternalEngineTests extends ESTestCase {
final Engine.IndexResult result = initialEngine.index(index);
if (!result.hasFailure()) {
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));
assertThat(initialEngine.seqNoService().getMaxSeqNo(), equalTo(primarySeqNo + 1));
indexedIds.add(id);
primarySeqNo++;
assertThat(result.getSeqNo(), equalTo(primarySeqNo));
} else {
assertThat(result.getSeqNo(), equalTo(SequenceNumbersService.UNASSIGNED_SEQ_NO));
assertThat(initialEngine.seqNoService().getMaxSeqNo(), equalTo(primarySeqNo));
}
}