Skip to content

Commit

Permalink
test: Made it possible to override the number of random test runs for…
Browse files Browse the repository at this point in the history
… the "all-types" test.
  • Loading branch information
chrisdutz committed Feb 4, 2024
1 parent 3733230 commit 7f600c8
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ public abstract class ManualTest {
private final boolean testWrite;
private final List<TestCase> testCases;

private final int numRandomReads;

public ManualTest(String connectionString) {
this(connectionString, true);
}

public ManualTest(String connectionString, boolean testWrite) {
this(connectionString, testWrite, 100);
}
public ManualTest(String connectionString, boolean testWrite, int numRandomReads) {
this.connectionString = connectionString;
this.testWrite = testWrite;
this.numRandomReads = numRandomReads;
testCases = new ArrayList<>();
}

Expand Down Expand Up @@ -129,8 +135,8 @@ public void run() throws Exception {
// Read all items in one big request.
// Shuffle the list of test cases and run the test 10 times.
System.out.println("Reading all items together in random order");
for (int i = 0; i < 100; i++) {
System.out.println(" - run number " + i + " of " + 100);
for (int i = 0; i < numRandomReads; i++) {
System.out.println(" - run number " + i + " of " + numRandomReads);
final List<TestCase> shuffledTestcases = new ArrayList<>(testCases);
Collections.shuffle(shuffledTestcases);

Expand Down

0 comments on commit 7f600c8

Please sign in to comment.