netudima commented on code in PR #4035: URL: https://github.com/apache/cassandra/pull/4035#discussion_r2033050302
########## test/unit/org/apache/cassandra/io/util/ThreadLocalReadAheadBufferTest.java: ########## @@ -41,18 +41,20 @@ import org.quicktheories.WithQuickTheories; import org.quicktheories.core.Gen; +import static java.lang.Math.max; import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_IO_TMPDIR; public class ThreadLocalReadAheadBufferTest implements WithQuickTheories { private static final int numFiles = 5; private static final File[] files = new File[numFiles]; private static final Logger logger = LoggerFactory.getLogger(ThreadLocalReadAheadBufferTest.class); + private static Integer seed; @BeforeClass public static void setup() { - int seed = new Random().nextInt(); + seed = new Random().nextInt(); logger.info("Seed: {}", seed); for (int i = 0; i < numFiles; i++) Review Comment: yes, we want to have the test to be fully reproducible using a single seed value, it means that all sources of randomness should be initialised using this seed. We have added it almost everywhere except the part where we generate files sizes: ``` { int size = new Random().nextInt((Integer.MAX_VALUE - 1) / 8); files[i] = writeFile(seed, size); } ``` So, my suggestion is to add it there as well, like: ``` { int size = new Random(seed).nextInt((Integer.MAX_VALUE - 1) / 8); files[i] = writeFile(seed, size); } ``` Github does not allow me to comment the needed line (line number: 62) below directly probably because it is too far from modified lines.. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org