Index: lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java =================================================================== --- lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java (revision 1345628) +++ lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreInstanceEnv.java (working copy) @@ -53,6 +53,12 @@ "Method not allowed to use postings format: " + pf.getName() + "."); } + // user uses -DpostingsFormat=xxx but test cannot work with it + if (LuceneTestCase.shouldAvoidCodec(LuceneTestCase.TEST_POSTINGSFORMAT)) { + throw new AssumptionViolatedException( + "Method not allowed to use postings format: " + LuceneTestCase.TEST_POSTINGSFORMAT + "."); + } + } protected void after() {