andygrove commented on code in PR #426:
URL: https://github.com/apache/datafusion-comet/pull/426#discussion_r1600328901
##########
spark/src/test/scala/org/apache/comet/CometCastSuite.scala:
##########
@@ -35,6 +35,9 @@ import org.apache.comet.expressions.{CometCast, Compatible}
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))
Review Comment:
To make sure I understand what you are suggesting, I think you are saying to
add this:
```
object DataGenerator {
val DEFAULT = new DataGenerator(new Random(42))
}
```
And then reference that from the test suite?
```
private val gen = DataGenerator.DEFAULT
```
I think this could lead to some non-deterministic behavior. For example,
running `CometCastSuite` on its own from my IDE would start with the freshly
created generator, but running the same suite after after test suites have run
would result in different inputs.
I think it would be better for each test to create a new instance of the
generator with a fixed seed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]