Buggy code:
public static final String TEST_LINE_DOCS_FILE = System . getProperty ( "tests.linedocsfile" , "europarl.lines.txt.gz" ) ; public static final String TEST_CLEAN_THREADS = System . getProperty ( "tests.cleanthreads" , "perClass" ) ; public static final Throttling TEST_THROTTLING = ( LuceneTestCase . TEST_NIGHTLY ) ? Throttling . SOMETIMES : Throttling . NEVER ; public static final int RANDOM_MULTIPLIER = Integer . parseInt ( System . getProperty ( "tests.multiplier" , "1" ) ) ; public static boolean PREFLEX_IMPERSONATION_IS_ACTIVE ; private boolean setupCalled ; private boolean teardownCalled ; private int savedBoolMaxClauseCount = BooleanQuery . getMaxClauseCount ( ) ; public static SegmentReader getOnlySegmentReader ( DirectoryReader reader ) { } private static Codec savedCodec ; private static InfoStream savedInfoStream ; private static Similarity similarity ; private static Locale locale ; private static Locale savedLocale ; private static TimeZone timeZone ; private static TimeZone savedTimeZone ; private static HashMap < String , String > restoreProperties = new HashMap < String , String > ( ) ; protected static Map < MockDirectoryWrapper , StackTraceElement [ ] > stores ; private static List < String > testClassesRun = new ArrayList < String > ( ) ; public static Random random ( ) { } @ Deprecated private static boolean icuTested = false ; private static final StoreClassNameRule classNameRule = new StoreClassNameRule ( ) ; private static final UncaughtExceptionsRule uncaughtExceptionsRule = new UncaughtExceptionsRule ( null ) ; private static final String [ ] ignoredInvariantProperties = new String [ ] { "user.timezone" } ; @ ClassRule public static TestRule classRules = RuleChain . outerRule ( new SystemPropertiesInvariantRule ( LuceneTestCase . ignoredInvariantProperties ) ) . around ( LuceneTestCase . classNameRule ) . around ( LuceneTestCase . uncaughtExceptionsRule ) ; @ Rule public final TestRule ruleChain = RuleChain . outerRule ( new LuceneTestCase . SaveThreadAndTestNameRule ( ) ) . around ( new UncaughtExceptionsRule ( this ) ) . around ( new LuceneTestCase . TestResultInterceptorRule ( ) ) . around ( new SystemPropertiesInvariantRule ( LuceneTestCase . ignoredInvariantProperties ) ) . around ( new LuceneTestCase . InternalSetupTeardownRule ( ) ) . around ( new LuceneTestCase . SubclassSetupTeardownRule ( ) ) ; @ BeforeClass static void beforeClassLuceneTestCaseJ4 ( ) { } @ AfterClass static void afterClassLuceneTestCaseJ4 ( ) { } private static void printDebuggingInformation ( String codecDescription ) { } private static void checkResourcesAfterClass ( ) { } private static void clearTempDirectoriesAfterClass ( ) { } protected static boolean testsFailed ; private class TestResultInterceptorRule implements TestRule { @ Override public Statement apply ( final Statement base , final Description description ) { } private void failed ( Throwable e , Description description ) { } } volatile Thread testCaseThread ; private class SaveThreadAndTestNameRule implements TestRule { private String previousName ; @ Override public Statement apply ( final Statement base , final Description description ) { } } private class InternalSetupTeardownRule implements TestRule { @ Override public Statement apply ( final Statement base , Description description ) { } } private final void setUpInternal ( ) throws Exception { } protected void purgeFieldCache ( final FieldCache fc ) { } protected String getTestLabel ( ) { } protected boolean isTestThread ( ) { } private class SubclassSetupTeardownRule implements TestRule { @ Override public Statement apply ( final Statement base , Description description ) { } } @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } private final void tearDownInternal ( ) throws Exception { } private void checkRogueThreadsAfter ( ) { } private static final int THREAD_STOP_GRACE_MSEC = 10 ; private static final IdentityHashMap < Thread , Boolean > rogueThreads = new IdentityHashMap < Thread , Boolean > ( ) ; private static int threadCleanup ( String context ) { } protected void assertSaneFieldCaches ( final String msg ) { } public static int atLeast ( Random random , int i ) { <START_BUG> int min = ( LuceneTestCase . TEST_NIGHTLY ? 3 * i : i ) * ( LuceneTestCase . RANDOM_MULTIPLIER ) ; <END_BUG> int max = min + ( min // 2 ) ; return _TestUtil . nextInt ( random , min , max ) ; } public static int atLeast ( int i ) { } public static boolean rarely ( Random random ) { } public static boolean rarely ( ) { } public static boolean usually ( Random random ) { } public static boolean usually ( ) { } public static void assumeTrue ( String msg , boolean b ) { } public static void assumeFalse ( String msg , boolean b ) { } public static void assumeNoException ( String msg , Exception e ) { } public static < T > Set < T > asSet ( T ... args ) { } public static void dumpIterator ( String label , Iterator < ? > iter , PrintStream stream ) { } public static void dumpArray ( String label , Object [ ] objs , PrintStream stream ) { } public static IndexWriterConfig newIndexWriterConfig ( Version v , Analyzer a ) { } public static IndexWriterConfig newIndexWriterConfig ( Random r , Version v , Analyzer a ) { } public static LogMergePolicy newLogMergePolicy ( ) { } public static TieredMergePolicy newTieredMergePolicy ( ) { } public static LogMergePolicy newLogMergePolicy ( Random r ) { } public static TieredMergePolicy newTieredMergePolicy ( Random r ) { } public static LogMergePolicy newLogMergePolicy ( boolean useCFS ) { } public static LogMergePolicy newLogMergePolicy ( boolean useCFS , int mergeFactor ) { } public static LogMergePolicy newLogMergePolicy ( int mergeFactor ) { } public static MockDirectoryWrapper newDirectory ( ) throws IOException { } public static MockDirectoryWrapper newDirectory ( Random r ) throws IOException { } public static MockDirectoryWrapper newDirectory ( Directory d ) throws IOException { } public static MockDirectoryWrapper newFSDirectory ( File f ) throws IOException { } public static MockDirectoryWrapper newFSDirectory ( File f , LockFactory lf ) throws IOException { }

Fix:
int min = ( LuceneTestCase . TEST_NIGHTLY ? 2 * i : i ) * ( LuceneTestCase . RANDOM_MULTIPLIER ) ;