Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed May 14, 2024
1 parent b109871 commit edf28d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spark/src/test/scala/org/apache/comet/CometCastSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
import testImplicits._

/** Create a data generator using a fixed seed so that tests are reproducible */
private val gen = new DataGenerator(new Random(42))
private val gen = DataGenerator.DEFAULT

/** Number of random data items to generate in each test */
private val dataSize = 10000
Expand Down
7 changes: 7 additions & 0 deletions spark/src/test/scala/org/apache/comet/DataGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ package org.apache.comet

import scala.util.Random

object DataGenerator {
// note that we use `def` rather than `val` intentionally here so that
// each test suite starts with a fresh data generator to help ensure
// that tests are deterministic
def DEFAULT = new DataGenerator(new Random(42))
}

class DataGenerator(r: Random) {

/** Generate a random string using the specified characters */
Expand Down

0 comments on commit edf28d9

Please sign in to comment.