TranslogTests#commit didn't allow for a concurrent closing of a view

The view closing will trim unneeded files but there is a small window where they may still be around.
This commit is contained in:
Boaz Leskes 2017-06-11 19:09:01 +02:00
parent 7182577904
commit 9b8754e4c2
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ public class TranslogTests extends ESTestCase {
if (deletionPolicy.pendingViewsCount() == 0) {
assertThat(deletionPolicy.minTranslogGenRequired(), equalTo(genToCommit));
}
assertThat(translog.getMinFileGeneration(), equalTo(deletionPolicy.minTranslogGenRequired()));
// we may have some views closed concurrently causing the deletion policy to increase it's minTranslogGenRequired
assertThat(translog.getMinFileGeneration(), lessThanOrEqualTo(deletionPolicy.minTranslogGenRequired()));
}
@Override