From c53bde5c7b2edef4ac4fc3666c783391b3bac7ec Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 7 May 2015 21:18:25 +0200 Subject: [PATCH] [TEST] only roll over translog if we at least add one operation --- .../java/org/elasticsearch/index/translog/TranslogTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/index/translog/TranslogTests.java b/src/test/java/org/elasticsearch/index/translog/TranslogTests.java index 583058d019b..bf8603dbd8c 100644 --- a/src/test/java/org/elasticsearch/index/translog/TranslogTests.java +++ b/src/test/java/org/elasticsearch/index/translog/TranslogTests.java @@ -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(); } }