diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java
index f3692af449e..dc3c8768ee1 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene60/TestLucene60PointsFormat.java
@@ -56,9 +56,7 @@ public class TestLucene60PointsFormat extends BasePointsFormatTestCase {
     IndexWriterConfig iwc = newIndexWriterConfig();
     // Avoid mockRandomMP since it may cause non-optimal merges that make the
     // number of points per leaf hard to predict
-    while (iwc.getMergePolicy() instanceof MockRandomMergePolicy) {
-      iwc.setMergePolicy(newMergePolicy());
-    }
+    iwc.setMergePolicy(newMergePolicy(random(), false));
     IndexWriter w = new IndexWriter(dir, iwc);
     byte[] pointValue = new byte[3];
     byte[] uniquePointValue = new byte[3];
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
index 47c41be0beb..55870daec4c 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
@@ -177,6 +177,7 @@ public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatT
     Directory dir = newFSDirectory(createTempDir());
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     conf.setMergeScheduler(new SerialMergeScheduler());
+    conf.setMergePolicy(newMergePolicy(random(), false));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);
 
     // sparse compression is only enabled if less than 1% of docs have a value
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java
index fce0a390ea6..3993624e503 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java
@@ -170,6 +170,7 @@ public abstract class BaseLucene80DocValuesFormatTestCase
     Directory dir = newFSDirectory(createTempDir());
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     conf.setMergeScheduler(new SerialMergeScheduler());
+    conf.setMergePolicy(newMergePolicy(random(), false));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);
 
     // sparse compression is only enabled if less than 1% of docs have a value
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene86/TestLucene86PointsFormat.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene86/TestLucene86PointsFormat.java
index c03401ec14b..b48c9364780 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/lucene86/TestLucene86PointsFormat.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene86/TestLucene86PointsFormat.java
@@ -31,7 +31,6 @@ import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.LeafReader;
-import org.apache.lucene.index.MockRandomMergePolicy;
 import org.apache.lucene.index.PointValues;
 import org.apache.lucene.index.PointValues.IntersectVisitor;
 import org.apache.lucene.index.PointValues.Relation;
@@ -103,9 +102,7 @@ public class TestLucene86PointsFormat extends BasePointsFormatTestCase {
     IndexWriterConfig iwc = newIndexWriterConfig();
     // Avoid mockRandomMP since it may cause non-optimal merges that make the
     // number of points per leaf hard to predict
-    while (iwc.getMergePolicy() instanceof MockRandomMergePolicy) {
-      iwc.setMergePolicy(newMergePolicy());
-    }
+    iwc.setMergePolicy(newMergePolicy(random(), false));
     IndexWriter w = new IndexWriter(dir, iwc);
     byte[] pointValue = new byte[3];
     byte[] uniquePointValue = new byte[3];
diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/BaseLucene90DocValuesFormatTestCase.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/BaseLucene90DocValuesFormatTestCase.java
index 19bc5425ec9..0c66cbc72ed 100644
--- a/lucene/core/src/test/org/apache/lucene/codecs/lucene90/BaseLucene90DocValuesFormatTestCase.java
+++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene90/BaseLucene90DocValuesFormatTestCase.java
@@ -170,6 +170,7 @@ public abstract class BaseLucene90DocValuesFormatTestCase
     Directory dir = newFSDirectory(createTempDir());
     IndexWriterConfig conf = newIndexWriterConfig(new MockAnalyzer(random()));
     conf.setMergeScheduler(new SerialMergeScheduler());
+    conf.setMergePolicy(newMergePolicy(random(), false));
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir, conf);
 
     // sparse compression is only enabled if less than 1% of docs have a value
diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java
index f5bfb9ead30..c6557aade23 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonPointDistanceFeatureQuery.java
@@ -461,7 +461,7 @@ public class TestLatLonPointDistanceFeatureQuery extends LuceneTestCase {
     LatLonDocValuesField docValue = new LatLonDocValuesField("foo", 0., 0.);
     doc.add(docValue);
 
-    int numDocs = atLeast(10000);
+    int numDocs = TEST_NIGHTLY ? atLeast(10000) : atLeast(500);
     for (int i = 0; i < numDocs; ++i) {
       double lat = random().nextDouble() * 180 - 90;
       double lon = random().nextDouble() * 360 - 180;
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
index e096cb503a2..59ef2a6cdc7 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
@@ -73,7 +73,7 @@ public class TestBagOfPostings extends LuceneTestCase {
     Directory dir = newFSDirectory(createTempDir("bagofpostings"));
     final RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwc);
 
-    int threadCount = TestUtil.nextInt(random(), 1, 5);
+    int threadCount = TEST_NIGHTLY ? TestUtil.nextInt(random(), 1, 2) : TestUtil.nextInt(random(), 1, 5);
     if (VERBOSE) {
       System.out.println("config: " + iw.w.getConfig());
       System.out.println("threadCount=" + threadCount);
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java
index 423a3174a6c..a0ccf6221bb 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexManyDocuments.java
@@ -24,8 +24,10 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.lucene.util.TestUtil;
 
+@SuppressCodecs("SimpleText")
 public class TestIndexManyDocuments extends LuceneTestCase {
 
   public void test() throws Exception {
@@ -33,7 +35,7 @@ public class TestIndexManyDocuments extends LuceneTestCase {
     IndexWriterConfig iwc = new IndexWriterConfig();
     iwc.setMaxBufferedDocs(TestUtil.nextInt(random(), 100, 2000));
 
-    int numDocs = atLeast(10000);
+    int numDocs = TEST_NIGHTLY ? atLeast(10000) : atLeast(1000);
 
     final IndexWriter w = new IndexWriter(dir, iwc);
     final AtomicInteger count = new AtomicInteger();
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
index deb938de8b2..9f2464aafab 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexSorting.java
@@ -1911,7 +1911,8 @@ public class TestIndexSorting extends LuceneTestCase {
     final int numDocs = atLeast(100);
     Thread[] threads = new Thread[2];
 
-    final AtomicInteger updateCount = new AtomicInteger(atLeast(1000));
+    final AtomicInteger updateCount =
+        new AtomicInteger(TEST_NIGHTLY ? atLeast(1000) : atLeast(200));
     final CountDownLatch latch = new CountDownLatch(1);
     for (int i = 0; i < threads.length; ++i) {
       Random r = new Random(random().nextLong());
@@ -2540,7 +2541,7 @@ public class TestIndexSorting extends LuceneTestCase {
 
   // pits index time sorting against query time sorting
   public void testRandom3() throws Exception {
-    int numDocs = atLeast(1000);
+    int numDocs = TEST_NIGHTLY ? atLeast(1000) : atLeast(100);
     List<RandomDoc> docs = new ArrayList<>();
 
     Sort sort = randomSort();
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
index 1ee58132a52..af77342a949 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
@@ -4268,9 +4268,11 @@ public class TestIndexWriter extends LuceneTestCase {
         IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig());
         SearcherManager manager = new SearcherManager(writer, new SearcherFactory())) {
       CountDownLatch start = new CountDownLatch(1);
-      int numDocs = 100 + random().nextInt(500);
+      int maxDocs = TEST_NIGHTLY ? 600 : 100;
+      int numDocs = TestUtil.nextInt(random(), 100, maxDocs);
       AtomicLong maxCompletedSeqID = new AtomicLong(-1);
-      Thread[] threads = new Thread[2 + random().nextInt(2)];
+      int maxThreads = TEST_NIGHTLY ? 4 : 2;
+      Thread[] threads = new Thread[TestUtil.nextInt(random(), 2, maxThreads)];
       for (int i = 0; i < threads.length; i++) {
         int idx = i;
         threads[i] =
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
index 6851fa3b056..22a8e3fa55d 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterForceMerge.java
@@ -37,7 +37,7 @@ public class TestIndexWriterForceMerge extends LuceneTestCase {
 
     final Document doc = new Document();
     doc.add(newStringField("content", "aaa", Field.Store.NO));
-    final int incrMin = TEST_NIGHTLY ? 15 : 40;
+    final int incrMin = TEST_NIGHTLY ? 15 : 120;
     for (int numDocs = 10;
         numDocs < 500;
         numDocs += TestUtil.nextInt(random(), incrMin, 5 * incrMin)) {
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
index 2578712bba5..86dd884aa65 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
@@ -33,6 +33,7 @@ import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
 
 public class TestIndexWriterMergePolicy extends LuceneTestCase {
 
@@ -724,7 +725,7 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {
                       new MergeOnXMergePolicy(
                           newMergePolicy(),
                           useGetReader ? MergeTrigger.GET_READER : MergeTrigger.COMMIT))
-                  .setMaxFullFlushMergeWaitMillis(10 + random().nextInt(2000))
+                  .setMaxFullFlushMergeWaitMillis(10 + random().nextInt(200))
                   .setSoftDeletesField("soft_delete")
                   .setMergeScheduler(new ConcurrentMergeScheduler()))) {
         Document d1 = new Document();
@@ -732,11 +733,12 @@ public class TestIndexWriterMergePolicy extends LuceneTestCase {
         writer.updateDocument(new Term("id", "1"), d1);
         writer.commit();
 
-        AtomicInteger iters = new AtomicInteger(100 + random().nextInt(TEST_NIGHTLY ? 5000 : 1000));
+        AtomicInteger iters = new AtomicInteger(100 + random().nextInt(TEST_NIGHTLY ? 5000 : 100));
         AtomicInteger numFullFlushes =
-            new AtomicInteger(10 + random().nextInt(TEST_NIGHTLY ? 500 : 100));
+            new AtomicInteger(10 + random().nextInt(TEST_NIGHTLY ? 500 : 10));
         AtomicBoolean done = new AtomicBoolean(false);
-        Thread[] threads = new Thread[1 + random().nextInt(4)];
+        int maxThreads = TEST_NIGHTLY ? 5 : 2;
+        Thread[] threads = new Thread[TestUtil.nextInt(random(), 1, maxThreads)];
         for (int i = 0; i < threads.length; i++) {
           Thread t =
               new Thread(
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
index cde8e282bf1..0413039b32e 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
@@ -29,6 +29,7 @@ import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 import org.apache.lucene.util.TestUtil;
 import org.junit.Before;
 
@@ -38,6 +39,7 @@ import org.junit.Before;
  *
  * <p>Skipping in general is already covered by several other testcases.
  */
+@SuppressCodecs("SimpleText") // uses a ton of docs, too slow on SimpleText
 public class TestMultiLevelSkipList extends LuceneTestCase {
 
   class CountingDirectory extends MockDirectoryWrapper {
@@ -67,7 +69,7 @@ public class TestMultiLevelSkipList extends LuceneTestCase {
             dir,
             newIndexWriterConfig(new PayloadAnalyzer())
                 .setCodec(TestUtil.alwaysPostingsFormat(TestUtil.getDefaultPostingsFormat()))
-                .setMergePolicy(newLogMergePolicy()));
+                .setMergePolicy(new LogByteSizeMergePolicy()));
     Term term = new Term("test", "a");
     for (int i = 0; i < 5000; i++) {
       Document d1 = new Document();
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java b/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java
index 2bc6b16662a..91f3f9d2ab0 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSortingCodecReader.java
@@ -133,7 +133,7 @@ public class TestSortingCodecReader extends LuceneTestCase {
           FieldType ft = new FieldType(StringField.TYPE_NOT_STORED);
           ft.setStoreTermVectors(true);
           doc.add(new Field("term_vectors", "test" + docId, ft));
-          if (rarely() == false) {
+          if (i == 3) {
             doc.add(new NumericDocValuesField("id", docId));
             doc.add(
                 new SortedSetDocValuesField(
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java b/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java
index f6615b8bf8c..bd8ea29f8f3 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java
@@ -44,7 +44,7 @@ public class TestStressAdvance extends LuceneTestCase {
       doc.add(f);
       final Field idField = newStringField("id", "", Field.Store.YES);
       doc.add(idField);
-      int num = atLeast(4097);
+      int num = TEST_NIGHTLY ? atLeast(4097) : atLeast(129);
       if (VERBOSE) {
         System.out.println("\nTEST: numDocs=" + num);
       }
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java
index a955cb6190c..ce541228055 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanOr.java
@@ -34,6 +34,8 @@ import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.FixedBitSet;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 
 public class TestBooleanOr extends LuceneTestCase {
 
@@ -45,9 +47,38 @@ public class TestBooleanOr extends LuceneTestCase {
   private TermQuery c1 = new TermQuery(new Term(FIELD_C, "production"));
   private TermQuery c2 = new TermQuery(new Term(FIELD_C, "optimize"));
 
-  private IndexSearcher searcher = null;
-  private Directory dir;
-  private IndexReader reader;
+  private static IndexSearcher searcher = null;
+  private static Directory dir;
+  private static IndexReader reader;
+
+  @BeforeClass
+  public static void beforeClass() throws Exception {
+    dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
+
+    Document d = new Document();
+    d.add(newField(FIELD_T, "Optimize not deleting all files", TextField.TYPE_STORED));
+    d.add(
+        newField(
+            FIELD_C,
+            "Deleted When I run an optimize in our production environment.",
+            TextField.TYPE_STORED));
+
+    writer.addDocument(d);
+
+    reader = writer.getReader();
+    searcher = newSearcher(reader);
+    writer.close();
+  }
+
+  @AfterClass
+  public static void afterClass() throws Exception {
+    reader.close();
+    dir.close();
+    dir = null;
+    reader = null;
+    searcher = null;
+  }
 
   private long search(Query q) throws IOException {
     QueryUtils.check(random(), q, searcher);
@@ -113,47 +144,12 @@ public class TestBooleanOr extends LuceneTestCase {
     assertEquals(1, search(q2.build()));
   }
 
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-
-    //
-    dir = newDirectory();
-
-    //
-    RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
-
-    //
-    Document d = new Document();
-    d.add(newField(FIELD_T, "Optimize not deleting all files", TextField.TYPE_STORED));
-    d.add(
-        newField(
-            FIELD_C,
-            "Deleted When I run an optimize in our production environment.",
-            TextField.TYPE_STORED));
-
-    //
-    writer.addDocument(d);
-
-    reader = writer.getReader();
-    //
-    searcher = newSearcher(reader);
-    writer.close();
-  }
-
-  @Override
-  public void tearDown() throws Exception {
-    reader.close();
-    dir.close();
-    super.tearDown();
-  }
-
   public void testBooleanScorerMax() throws IOException {
     Directory dir = newDirectory();
     RandomIndexWriter riw =
         new RandomIndexWriter(random(), dir, newIndexWriterConfig(new MockAnalyzer(random())));
 
-    int docCount = atLeast(10000);
+    int docCount = TEST_NIGHTLY ? atLeast(10000) : atLeast(200);
 
     for (int i = 0; i < docCount; i++) {
       Document doc = new Document();
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java
index 61b316b6441..0afc51d468c 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestIndexOrDocValuesQuery.java
@@ -42,7 +42,8 @@ public class TestIndexOrDocValuesQuery extends LuceneTestCase {
             newIndexWriterConfig()
                 // relies on costs and PointValues.estimateCost so we need the default codec
                 .setCodec(TestUtil.getDefaultCodec()));
-    for (int i = 0; i < 2000; ++i) {
+    int numDocs = TEST_NIGHTLY ? 2000 : atLeast(150);
+    for (int i = 0; i < numDocs; ++i) {
       Document doc = new Document();
       if (i == 42) {
         doc.add(new StringField("f1", "bar", Store.NO));
@@ -107,7 +108,8 @@ public class TestIndexOrDocValuesQuery extends LuceneTestCase {
             newIndexWriterConfig()
                 // relies on costs and PointValues.estimateCost so we need the default codec
                 .setCodec(TestUtil.getDefaultCodec()));
-    for (int i = 0; i < 2000; ++i) {
+    int numDocs = TEST_NIGHTLY ? 2000 : 1002;
+    for (int i = 0; i < numDocs; ++i) {
       Document doc = new Document();
       if (i < 1000) {
         doc.add(new StringField("f1", "bar", Store.NO));
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
index 4d19a82d958..956bf0a1fd9 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
@@ -31,22 +31,27 @@ import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.English;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 
 public class TestLongValuesSource extends LuceneTestCase {
 
   private static final long LEAST_LONG_VALUE = 45L;
 
-  private Directory dir;
-  private IndexReader reader;
-  private IndexSearcher searcher;
+  private static Directory dir;
+  private static IndexReader reader;
+  private static IndexSearcher searcher;
 
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
+  @BeforeClass
+  public static void beforeClass() throws Exception {
     dir = newDirectory();
     RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
-    int numDocs = TestUtil.nextInt(random(), 2049, 4000);
-    int leastValue = 45;
+    final int numDocs;
+    if (TEST_NIGHTLY) {
+      numDocs = TestUtil.nextInt(random(), 2049, 4000);
+    } else {
+      numDocs = TestUtil.nextInt(random(), 546, 600);
+    }
     for (int i = 0; i < numDocs; i++) {
       Document document = new Document();
       document.add(newTextField("english", English.intToEnglish(i), Field.Store.NO));
@@ -61,11 +66,13 @@ public class TestLongValuesSource extends LuceneTestCase {
     searcher = newSearcher(reader);
   }
 
-  @Override
-  public void tearDown() throws Exception {
+  @AfterClass
+  public static void afterClass() throws Exception {
     reader.close();
     dir.close();
-    super.tearDown();
+    searcher = null;
+    reader = null;
+    dir = null;
   }
 
   public void testSortMissingZeroDefault() throws Exception {
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
index efe218ae6b4..973f49be837 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPointQueries.java
@@ -1267,7 +1267,7 @@ public class TestPointQueries extends LuceneTestCase {
   }
 
   private static Codec getCodec() {
-    if (Codec.getDefault().getName().equals("Lucene84")) {
+    if (Codec.getDefault().getName().equals("Lucene90")) {
       int maxPointsInLeafNode = TestUtil.nextInt(random(), 16, 2048);
       double maxMBSortInHeap = 5.0 + (3 * random().nextDouble());
       if (VERBOSE) {
@@ -1278,7 +1278,7 @@ public class TestPointQueries extends LuceneTestCase {
                 + maxMBSortInHeap);
       }
 
-      return new FilterCodec("Lucene84", Codec.getDefault()) {
+      return new FilterCodec("Lucene90", Codec.getDefault()) {
         @Override
         public PointsFormat pointsFormat() {
           return new PointsFormat() {
@@ -1404,7 +1404,12 @@ public class TestPointQueries extends LuceneTestCase {
       valuesSet.add(randomIntValue(valueMin, valueMax));
     }
     int[] values = toArray(valuesSet);
-    int numDocs = TestUtil.nextInt(random(), 1, 10000);
+    final int numDocs;
+    if (TEST_NIGHTLY) {
+      numDocs = TestUtil.nextInt(random(), 1, 10000);
+    } else {
+      numDocs = TestUtil.nextInt(random(), 1, 200);
+    }
 
     if (VERBOSE) {
       System.out.println("TEST: numValues=" + numValues + " numDocs=" + numDocs);
@@ -1441,7 +1446,7 @@ public class TestPointQueries extends LuceneTestCase {
 
     IndexSearcher s = newSearcher(r, false);
 
-    int numThreads = TestUtil.nextInt(random(), 2, 5);
+    int numThreads = TEST_NIGHTLY ? TestUtil.nextInt(random(), 2, 5) : 2;
 
     if (VERBOSE) {
       System.out.println("TEST: use " + numThreads + " query threads; searcher=" + s);
@@ -1642,7 +1647,8 @@ public class TestPointQueries extends LuceneTestCase {
     IndexWriter w = new IndexWriter(dir, iwc);
 
     int zeroCount = 0;
-    for (int i = 0; i < 10000; i++) {
+    int numDocs = TEST_NIGHTLY ? 10000 : 200;
+    for (int i = 0; i < numDocs; i++) {
       int x = random().nextInt(2);
       if (x == 0) {
         zeroCount++;
@@ -1655,7 +1661,7 @@ public class TestPointQueries extends LuceneTestCase {
     IndexSearcher s = newSearcher(r, false);
 
     assertEquals(zeroCount, s.count(newMultiDimIntSetQuery("int", 2, 0, 0)));
-    assertEquals(10000 - zeroCount, s.count(newMultiDimIntSetQuery("int", 2, 1, 1)));
+    assertEquals(numDocs - zeroCount, s.count(newMultiDimIntSetQuery("int", 2, 1, 1)));
     assertEquals(0, s.count(newMultiDimIntSetQuery("int", 2, 2, 2)));
 
     w.close();
@@ -1899,7 +1905,8 @@ public class TestPointQueries extends LuceneTestCase {
     IndexWriter w = new IndexWriter(dir, iwc);
 
     int zeroCount = 0;
-    for (int i = 0; i < 10000; i++) {
+    int numDocs = TEST_NIGHTLY ? 10000 : 200;
+    for (int i = 0; i < numDocs; i++) {
       int x = random().nextInt(2);
       if (x == 0) {
         zeroCount++;
@@ -1918,25 +1925,25 @@ public class TestPointQueries extends LuceneTestCase {
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 0)));
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 0, -7)));
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(IntPoint.newSetQuery("int", 1)));
+    assertEquals(numDocs - zeroCount, s.count(IntPoint.newSetQuery("int", 1)));
     assertEquals(0, s.count(IntPoint.newSetQuery("int", 2)));
 
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 0)));
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 0, -7)));
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(LongPoint.newSetQuery("long", 1)));
+    assertEquals(numDocs - zeroCount, s.count(LongPoint.newSetQuery("long", 1)));
     assertEquals(0, s.count(LongPoint.newSetQuery("long", 2)));
 
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 0)));
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 0, -7)));
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(FloatPoint.newSetQuery("float", 1)));
+    assertEquals(numDocs - zeroCount, s.count(FloatPoint.newSetQuery("float", 1)));
     assertEquals(0, s.count(FloatPoint.newSetQuery("float", 2)));
 
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 0)));
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 0, -7)));
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(DoublePoint.newSetQuery("double", 1)));
+    assertEquals(numDocs - zeroCount, s.count(DoublePoint.newSetQuery("double", 1)));
     assertEquals(0, s.count(DoublePoint.newSetQuery("double", 2)));
 
     assertEquals(zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {0})));
@@ -1944,7 +1951,7 @@ public class TestPointQueries extends LuceneTestCase {
         zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {0}, new byte[] {-7})));
     assertEquals(
         zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {7}, new byte[] {0})));
-    assertEquals(10000 - zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {1})));
+    assertEquals(numDocs - zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {1})));
     assertEquals(0, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {2})));
 
     w.close();
@@ -1962,7 +1969,8 @@ public class TestPointQueries extends LuceneTestCase {
 
     int zeroCount = 0;
     int oneCount = 0;
-    for (int i = 0; i < 10000; i++) {
+    int numDocs = TEST_NIGHTLY ? 10000 : 200;
+    for (int i = 0; i < numDocs; i++) {
       int x = random().nextInt(cardinality);
       if (x == 0) {
         zeroCount++;
@@ -1985,25 +1993,26 @@ public class TestPointQueries extends LuceneTestCase {
     assertEquals(oneCount, s.count(IntPoint.newRangeQuery("int", 1, 1)));
     assertEquals(zeroCount + oneCount, s.count(IntPoint.newRangeQuery("int", 0, 1)));
     assertEquals(
-        10000 - zeroCount - oneCount, s.count(IntPoint.newRangeQuery("int", 2, cardinality)));
+        numDocs - zeroCount - oneCount, s.count(IntPoint.newRangeQuery("int", 2, cardinality)));
 
     assertEquals(zeroCount, s.count(LongPoint.newRangeQuery("long", 0, 0)));
     assertEquals(oneCount, s.count(LongPoint.newRangeQuery("long", 1, 1)));
     assertEquals(zeroCount + oneCount, s.count(LongPoint.newRangeQuery("long", 0, 1)));
     assertEquals(
-        10000 - zeroCount - oneCount, s.count(LongPoint.newRangeQuery("long", 2, cardinality)));
+        numDocs - zeroCount - oneCount, s.count(LongPoint.newRangeQuery("long", 2, cardinality)));
 
     assertEquals(zeroCount, s.count(FloatPoint.newRangeQuery("float", 0, 0)));
     assertEquals(oneCount, s.count(FloatPoint.newRangeQuery("float", 1, 1)));
     assertEquals(zeroCount + oneCount, s.count(FloatPoint.newRangeQuery("float", 0, 1)));
     assertEquals(
-        10000 - zeroCount - oneCount, s.count(FloatPoint.newRangeQuery("float", 2, cardinality)));
+        numDocs - zeroCount - oneCount, s.count(FloatPoint.newRangeQuery("float", 2, cardinality)));
 
     assertEquals(zeroCount, s.count(DoublePoint.newRangeQuery("double", 0, 0)));
     assertEquals(oneCount, s.count(DoublePoint.newRangeQuery("double", 1, 1)));
     assertEquals(zeroCount + oneCount, s.count(DoublePoint.newRangeQuery("double", 0, 1)));
     assertEquals(
-        10000 - zeroCount - oneCount, s.count(DoublePoint.newRangeQuery("double", 2, cardinality)));
+        numDocs - zeroCount - oneCount,
+        s.count(DoublePoint.newRangeQuery("double", 2, cardinality)));
 
     assertEquals(
         zeroCount, s.count(BinaryPoint.newRangeQuery("bytes", new byte[] {0}, new byte[] {0})));
@@ -2013,7 +2022,7 @@ public class TestPointQueries extends LuceneTestCase {
         zeroCount + oneCount,
         s.count(BinaryPoint.newRangeQuery("bytes", new byte[] {0}, new byte[] {1})));
     assertEquals(
-        10000 - zeroCount - oneCount,
+        numDocs - zeroCount - oneCount,
         s.count(
             BinaryPoint.newRangeQuery("bytes", new byte[] {2}, new byte[] {(byte) cardinality})));
 
@@ -2029,7 +2038,8 @@ public class TestPointQueries extends LuceneTestCase {
     IndexWriter w = new IndexWriter(dir, iwc);
 
     int zeroCount = 0;
-    for (int i = 0; i < 10000; i++) {
+    int numDocs = TEST_NIGHTLY ? 10000 : 200;
+    for (int i = 0; i < numDocs; i++) {
       int x = 200 * random().nextInt(2);
       if (x == 0) {
         zeroCount++;
@@ -2048,25 +2058,25 @@ public class TestPointQueries extends LuceneTestCase {
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 0)));
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 0, -7)));
     assertEquals(zeroCount, s.count(IntPoint.newSetQuery("int", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(IntPoint.newSetQuery("int", 200)));
+    assertEquals(numDocs - zeroCount, s.count(IntPoint.newSetQuery("int", 200)));
     assertEquals(0, s.count(IntPoint.newSetQuery("int", 2)));
 
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 0)));
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 0, -7)));
     assertEquals(zeroCount, s.count(LongPoint.newSetQuery("long", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(LongPoint.newSetQuery("long", 200)));
+    assertEquals(numDocs - zeroCount, s.count(LongPoint.newSetQuery("long", 200)));
     assertEquals(0, s.count(LongPoint.newSetQuery("long", 2)));
 
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 0)));
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 0, -7)));
     assertEquals(zeroCount, s.count(FloatPoint.newSetQuery("float", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(FloatPoint.newSetQuery("float", 200)));
+    assertEquals(numDocs - zeroCount, s.count(FloatPoint.newSetQuery("float", 200)));
     assertEquals(0, s.count(FloatPoint.newSetQuery("float", 2)));
 
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 0)));
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 0, -7)));
     assertEquals(zeroCount, s.count(DoublePoint.newSetQuery("double", 7, 0)));
-    assertEquals(10000 - zeroCount, s.count(DoublePoint.newSetQuery("double", 200)));
+    assertEquals(numDocs - zeroCount, s.count(DoublePoint.newSetQuery("double", 200)));
     assertEquals(0, s.count(DoublePoint.newSetQuery("double", 2)));
 
     assertEquals(zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {0})));
@@ -2075,7 +2085,7 @@ public class TestPointQueries extends LuceneTestCase {
     assertEquals(
         zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {7}, new byte[] {0})));
     assertEquals(
-        10000 - zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {(byte) 200})));
+        numDocs - zeroCount, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {(byte) 200})));
     assertEquals(0, s.count(BinaryPoint.newSetQuery("bytes", new byte[] {2})));
 
     w.close();
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
index 1e843a97171..cdad356df37 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
@@ -33,6 +33,8 @@ import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks;
 import org.apache.lucene.util.TestUtil;
 import org.apache.lucene.util.ThreadInterruptedException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 
 /**
  * Tests the {@link TimeLimitingCollector}. This test checks (1) search correctness (regardless of
@@ -49,22 +51,19 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
   // but this is not a real failure, just noise.
   private static final double MULTI_THREAD_SLACK = 7;
 
-  private static final int N_DOCS = 3000;
-  private static final int N_THREADS = 50;
+  private static final String FIELD_NAME = "body";
 
-  private IndexSearcher searcher;
-  private Directory directory;
-  private IndexReader reader;
+  private static IndexSearcher searcher;
+  private static Directory directory;
+  private static IndexReader reader;
 
-  private final String FIELD_NAME = "body";
-  private Query query;
-  private Counter counter;
-  private TimerThread counterThread;
+  private static Query query;
+  private static Counter counter;
+  private static TimerThread counterThread;
 
   /** initializes searcher with a document set */
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
+  @BeforeClass
+  public static void beforeClass() throws Exception {
     counter = Counter.newCounter(true);
     counterThread = new TimerThread(counter);
     counterThread.start();
@@ -85,7 +84,8 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
             directory,
             newIndexWriterConfig(new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
 
-    for (int i = 0; i < N_DOCS; i++) {
+    final int nDocs = TEST_NIGHTLY ? 5000 : 200;
+    for (int i = 0; i < nDocs; i++) {
       add(docText[i % docText.length], iw);
     }
     reader = iw.getReader();
@@ -109,16 +109,20 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
     searcher.search(query, 1000);
   }
 
-  @Override
-  public void tearDown() throws Exception {
+  @AfterClass
+  public static void afterClass() throws Exception {
     reader.close();
     directory.close();
     counterThread.stopTimer();
     counterThread.join();
-    super.tearDown();
+    reader = null;
+    directory = null;
+    counterThread = null;
+    searcher = null;
+    query = null;
   }
 
-  private void add(String value, RandomIndexWriter iw) throws IOException {
+  private static void add(String value, RandomIndexWriter iw) throws IOException {
     Document d = new Document();
     d.add(newTextField(FIELD_NAME, value, Field.Store.NO));
     iw.addDocument(d);
@@ -324,8 +328,9 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
   }
 
   private void doTestMultiThreads(final boolean withTimeout) throws Exception {
-    Thread[] threadArray = new Thread[N_THREADS];
-    final BitSet success = new BitSet(N_THREADS);
+    int nThreads = TEST_NIGHTLY ? 20 : 2;
+    Thread[] threadArray = new Thread[nThreads];
+    final BitSet success = new BitSet(nThreads);
     for (int i = 0; i < threadArray.length; ++i) {
       final int num = i;
       threadArray[num] =
@@ -349,7 +354,7 @@ public class TestTimeLimitingCollector extends LuceneTestCase {
     for (int i = 0; i < threadArray.length; ++i) {
       threadArray[i].join();
     }
-    assertEquals("some threads failed!", N_THREADS, success.cardinality());
+    assertEquals("some threads failed!", nThreads, success.cardinality());
   }
 
   // counting collector that can slow down at collect().
diff --git a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
index a9380e35216..f445d42fa0e 100644
--- a/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
+++ b/lucene/core/src/test/org/apache/lucene/util/compress/LZ4TestCase.java
@@ -243,14 +243,16 @@ public abstract class LZ4TestCase extends LuceneTestCase {
   }
 
   public void testIncompressibleRandom() throws IOException {
-    byte[] b = new byte[TestUtil.nextInt(random(), 1, 1 << 32)];
+    int maxBytes = TEST_NIGHTLY ? 1 << 22 : 1 << 16;
+    byte[] b = new byte[TestUtil.nextInt(random(), 1, maxBytes)];
     random().nextBytes(b);
     doTest(b, newHashTable());
     doTestWithDictionary(b, newHashTable());
   }
 
   public void testCompressibleRandom() throws IOException {
-    byte[] b = new byte[TestUtil.nextInt(random(), 1, 1 << 18)];
+    int maxBytes = TEST_NIGHTLY ? 1 << 18 : 1 << 16;
+    byte[] b = new byte[TestUtil.nextInt(random(), 1, maxBytes)];
     final int base = random().nextInt(256);
     final int maxDelta = 1 + random().nextInt(8);
     Random r = random();
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
index 36d16c3d255..d6399677d7e 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
@@ -287,7 +287,7 @@ public class TestSuggestField extends LuceneTestCase {
     Analyzer analyzer = new MockAnalyzer(random());
     RandomIndexWriter iw =
         new RandomIndexWriter(random(), dir, iwcWithSuggestField(analyzer, "suggest_field"));
-    final int num = atLeast(500);
+    final int num = TEST_NIGHTLY ? atLeast(500) : atLeast(50);
     int bestWeight = Integer.MIN_VALUE;
     for (int i = 0; i < num; i++) {
       Document document = new Document();
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
index 860de668dcf..4961a4dc615 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
@@ -3521,7 +3521,7 @@ public abstract class BaseDocValuesFormatTestCase extends BaseIndexFileFormatTes
     for (int i = 0; i < numChunks; i++) {
       // change sparseness for each chunk
       double sparseChance = random().nextDouble();
-      int docCount = atLeast(1000);
+      int docCount = TEST_NIGHTLY ? atLeast(1000) : atLeast(50);
       for (int j = 0; j < docCount; j++) {
         Document doc = new Document();
         doc.add(new StoredField("id", id));
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
index d66bf88a109..3582e2b3d4a 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
@@ -502,13 +502,13 @@ public abstract class BaseStoredFieldsFormatTestCase extends BaseIndexFileFormat
     final byte[][][] data = new byte[docCount][][];
     for (int i = 0; i < docCount; ++i) {
       final int fieldCount =
-          rarely()
+          TEST_NIGHTLY
               ? RandomNumbers.randomIntBetween(random(), 1, 500)
               : RandomNumbers.randomIntBetween(random(), 1, 5);
       data[i] = new byte[fieldCount][];
       for (int j = 0; j < fieldCount; ++j) {
-        final int length = rarely() ? random().nextInt(1000) : random().nextInt(10);
-        final int max = rarely() ? 256 : 2;
+        final int length = TEST_NIGHTLY ? random().nextInt(1000) : random().nextInt(10);
+        final int max = TEST_NIGHTLY ? 256 : 2;
         data[i][j] = randomByteArray(length, max);
       }
     }
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
index 5f958cf3eb7..87a9343ac41 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
@@ -685,9 +685,6 @@ public abstract class BaseTermVectorsFormatTestCase extends BaseIndexFileFormatT
       final RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
       for (int i = 0; i < numDocs; ++i) {
         writer.addDocument(addId(docs[i].toDocument(), "" + i));
-        if (rarely()) {
-          writer.commit();
-        }
       }
       for (int delete : deletes) {
         writer.deleteDocuments(new Term("id", "" + delete));
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java b/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
index acf21776313..c6b6b40d1d8 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/RandomIndexWriter.java
@@ -145,7 +145,11 @@ public class RandomIndexWriter implements Closeable {
     }
     w = mockIndexWriter(dir, c, r);
     config = w.getConfig();
-    flushAt = TestUtil.nextInt(r, 10, 1000);
+    if (LuceneTestCase.TEST_NIGHTLY) {
+      flushAt = TestUtil.nextInt(r, 10, 1000);
+    } else {
+      flushAt = TestUtil.nextInt(r, 100, 1000);
+    }
     if (closeAnalyzer) {
       analyzer = w.getAnalyzer();
     } else {
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index f05b62f4561..33a1de291d5 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -990,12 +990,15 @@ public abstract class LuceneTestCase extends Assert {
     }
 
     if (r.nextBoolean()) {
-      if (rarely(r)) {
+      if (TEST_NIGHTLY && rarely(r)) {
         // crazy value
         c.setMaxBufferedDocs(TestUtil.nextInt(r, 2, 15));
+      } else if (rarely(r)) {
+        // semi-crazy value
+        c.setMaxBufferedDocs(TestUtil.nextInt(r, 16, 127));
       } else {
         // reasonable value
-        c.setMaxBufferedDocs(TestUtil.nextInt(r, 16, 1000));
+        c.setMaxBufferedDocs(TestUtil.nextInt(r, 128, 1000));
       }
     }
 
@@ -1087,12 +1090,12 @@ public abstract class LuceneTestCase extends Assert {
     return newMergePolicy(r, true);
   }
 
-  public static MergePolicy newMergePolicy(Random r, boolean includeMockMP) {
-    if (includeMockMP && rarely(r)) {
+  public static MergePolicy newMergePolicy(Random r, boolean includeSlowMP) {
+    if (includeSlowMP && rarely(r)) {
       return new MockRandomMergePolicy(r);
     } else if (r.nextBoolean()) {
       return newTieredMergePolicy(r);
-    } else if (rarely(r)) {
+    } else if (includeSlowMP && rarely(r)) {
       return newAlcoholicMergePolicy(r, classEnvRule.timeZone);
     }
     return newLogMergePolicy(r);
@@ -1190,12 +1193,14 @@ public abstract class LuceneTestCase extends Assert {
   }
 
   // if you want it in LiveIndexWriterConfig: it must and will be tested here.
+  // this method gets called often in tests, try to avoid creating mounds of garbage
   public static void maybeChangeLiveIndexWriterConfig(Random r, LiveIndexWriterConfig c) {
     boolean didChange = false;
 
-    String previous = c.toString();
+    String previous = null;
 
     if (rarely(r)) {
+      if (previous == null) previous = c.toString();
       // change flush parameters:
       // this is complicated because the api requires you "invoke setters in a magical order!"
       // LUCENE-5661: workaround for race conditions in the API
@@ -1218,12 +1223,15 @@ public abstract class LuceneTestCase extends Assert {
           c.setRAMBufferSizeMB(TestUtil.nextInt(r, 1, 10));
           c.setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
         } else {
-          if (rarely(r)) {
+          if (TEST_NIGHTLY && rarely(r)) {
             // crazy value
             c.setMaxBufferedDocs(TestUtil.nextInt(r, 2, 15));
+          } else if (rarely(r)) {
+            // semi-crazy value
+            c.setMaxBufferedDocs(TestUtil.nextInt(r, 16, 127));
           } else {
             // reasonable value
-            c.setMaxBufferedDocs(TestUtil.nextInt(r, 16, 1000));
+            c.setMaxBufferedDocs(TestUtil.nextInt(r, 128, 1000));
           }
           c.setRAMBufferSizeMB(IndexWriterConfig.DISABLE_AUTO_FLUSH);
         }
@@ -1232,6 +1240,7 @@ public abstract class LuceneTestCase extends Assert {
     }
 
     if (rarely(r)) {
+      if (previous == null) previous = c.toString();
       IndexWriter.IndexReaderWarmer curWarmer = c.getMergedSegmentWarmer();
       if (curWarmer == null || curWarmer instanceof SimpleMergedSegmentWarmer) {
         // change warmer parameters
@@ -1245,12 +1254,14 @@ public abstract class LuceneTestCase extends Assert {
     }
 
     if (rarely(r)) {
+      if (previous == null) previous = c.toString();
       // change CFS flush parameters
       c.setUseCompoundFile(r.nextBoolean());
       didChange = true;
     }
 
     if (rarely(r)) {
+      if (previous == null) previous = c.toString();
       // change CMS merge parameters
       MergeScheduler ms = c.getMergeScheduler();
       if (ms instanceof ConcurrentMergeScheduler) {
@@ -1269,6 +1280,7 @@ public abstract class LuceneTestCase extends Assert {
     }
 
     if (rarely(r)) {
+      if (previous == null) previous = c.toString();
       MergePolicy mp = c.getMergePolicy();
       configureRandom(r, mp);
       if (mp instanceof LogMergePolicy) {
