Skip to content

Commit

Permalink
HSEARCH-3775 Improve robustness of LuceneIndexWriterCommitIT
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Feb 13, 2020
1 parent 545c28c commit 16251a7
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.search.integrationtest.backend.lucene.lowlevel.writer;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.hibernate.search.util.impl.integrationtest.common.stub.mapper.StubMapperUtils.referenceProvider;

import java.io.IOException;
Expand Down Expand Up @@ -97,7 +98,15 @@ public void commitStrategyNone() throws IOException {
plan.execute().join();

// Commit will happen some time after indexing finished
Awaitility.await().untilAsserted( () -> assertThat( countDocsOnDisk() ).isEqualTo( 1 ) );
Awaitility.await().untilAsserted( () -> {
try {
assertThat( countDocsOnDisk() ).isEqualTo( 1 );
}
catch (IOException e) {
// May happen if we call the method *right* as a commit is executing
fail( "countDocsOnDisk() failed: " + e.getMessage(), e );
}
} );
}

@Test
Expand Down

0 comments on commit 16251a7

Please sign in to comment.