From 6407d49ae3d7a4749444df6ddf27103ebcafa874 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Sat, 30 Jun 2012 09:01:07 +0000 Subject: [PATCH] LUCENE-4160: don't take into account global tests.iters in this test. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1355669 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/org/apache/lucene/util/TestMaxFailuresRule.java | 8 +++++++- .../junitcompat/TestSameRandomnessLocalePassedOrNot.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java b/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java index 6bdc584b7e9..bd92eae0e2d 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestMaxFailuresRule.java @@ -20,21 +20,26 @@ package org.apache.lucene.util; import org.apache.lucene.util.junitcompat.WithNestedTests; import org.junit.Assert; import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; +import com.carrotsearch.randomizedtesting.SysGlobals; import com.carrotsearch.randomizedtesting.annotations.Repeat; import com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule; +import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; /** * @see TestRuleIgnoreAfterMaxFailures * @see SystemPropertiesInvariantRule */ -@Ignore("DW: Check why this test doesn't pass from time to time.") public class TestMaxFailuresRule extends WithNestedTests { + @Rule + public SystemPropertiesRestoreRule restoreSysProps = new SystemPropertiesRestoreRule(); + public TestMaxFailuresRule() { super(true); } @@ -50,6 +55,7 @@ public class TestMaxFailuresRule extends WithNestedTests { public void testMaxFailures() { int maxFailures = LuceneTestCase.ignoreAfterMaxFailures.maxFailures; int failuresSoFar = LuceneTestCase.ignoreAfterMaxFailures.failuresSoFar; + System.clearProperty(SysGlobals.SYSPROP_ITERATIONS()); try { LuceneTestCase.ignoreAfterMaxFailures.maxFailures = 2; LuceneTestCase.ignoreAfterMaxFailures.failuresSoFar = 0; diff --git a/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java b/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java index fb703965d13..191348da2fb 100644 --- a/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java +++ b/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestSameRandomnessLocalePassedOrNot.java @@ -39,7 +39,7 @@ public class TestSameRandomnessLocalePassedOrNot extends WithNestedTests { RuleChain.outerRule(new SystemPropertiesRestoreRule()); public TestSameRandomnessLocalePassedOrNot() { - super(false); + super(true); } public static class Nested extends WithNestedTests.AbstractNestedTest {