Fix test case to verify the AssertionError did in fact come from IndexWriter.filesExist

This commit is contained in:
Michael McCandless 2015-09-16 04:58:16 -04:00 committed by mikemccand
parent 30a7795119
commit 0060a749ca
1 changed files with 6 additions and 3 deletions

View File

@ -41,6 +41,7 @@ import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.support.TransportActions; import org.elasticsearch.action.support.TransportActions;
import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.IndexMetaData;
@ -1728,9 +1729,11 @@ public class InternalEngineTests extends ESTestCase {
engine = createEngine(store, primaryTranslogDir); engine = createEngine(store, primaryTranslogDir);
started = true; started = true;
break; break;
} catch (EngineCreationFailureException | AssertionError ex) { } catch (EngineCreationFailureException ex) {
// IndexWriter can throw AssertionError on init (if asserts are enabled) if we throw FNFE/NSFE when it asserts that all } catch (AssertionError ex) {
// referenced files in the current commit point do exist // IndexWriter can throw AssertionError on init (if asserts are enabled) if our directory randomly throws FNFE/NSFE when
// it asserts that all referenced files in the current commit point do exist
assertTrue(ExceptionsHelper.stackTrace(ex).contains("org.apache.lucene.index.IndexWriter.filesExist"));
} }
} }