This is similar to David Smiley's question on Feb 16th, but SuppressCodecs would be too broad of a solution, I think.
I'm using LuceneTestCase's newIndexWriterConfig, and I have a test that requires IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS. The test passes quite often (famous last words), but I occasionally get an UnsupportedOperationException: this codec cannot index offsets. Is there a way to have LuceneTestCase randomly select a codec (with particular subcomponents/configurations) that supports indexing offsets? The codec that fails: codec=Lucene46: {f1:MockVariableIntBlock(baseBlockSize=71)}, docValues:{}, ... Most often, however Lucene46 does not fail.