[TEST] only roll over translog if we at least add one operation

This commit is contained in:
Simon Willnauer 2015-05-07 21:18:25 +02:00
parent 1cb6af7585
commit c53bde5c7b
1 changed files with 1 additions and 1 deletions

View File

@ -809,7 +809,7 @@ public class TranslogTests extends ElasticsearchTestCase {
int count = 0;
for (int op = 0; op < translogOperations; op++) {
locations.add(translog.add(new Translog.Create("test", "" + op, Integer.toString(++count).getBytes(Charset.forName("UTF-8")))));
if (rarely()) {
if (rarely() && translogOperations > op+1) {
translog.newTranslog();
}
}