Skip to content

Commit c4690dd

Browse files
committed
Add extra roll
1 parent 5ba7402 commit c4690dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/test/java/org/elasticsearch/index/translog/TranslogTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,10 @@ public void testPrepareCommitAndCommit() throws IOException {
22542254
if (rarely()) {
22552255
final long generation = translog.currentFileGeneration();
22562256
translog.prepareCommit();
2257+
if (rarely()) {
2258+
// simulate generation filling up and rolling between preparing the commit and committing
2259+
translog.rollGeneration();
2260+
}
22572261
translog.commit(randomIntBetween(1, Math.toIntExact(generation)));
22582262
for (long g = 0; i < generation; g++) {
22592263
assertFileDeleted(translog, g);

0 commit comments

Comments
 (0)