Skip to content

Commit

Permalink
fix flaky UT to avoid IllegalArgumentException: bound must be positive (
Browse files Browse the repository at this point in the history
  • Loading branch information
klsince authored Nov 15, 2022
1 parent e307106 commit 1ac7fb3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private List<GenericRow> createTestData() {
byte[][] tempBytesRows = new byte[rowLength][];
BigDecimal[] tempBigDecimalRows = new BigDecimal[rowLength];

int maxNumberOfMVEntries = random.nextInt(500);
int maxNumberOfMVEntries = random.nextInt(500) + 1;
String[][] tempMVStringRows = new String[rowLength][maxNumberOfMVEntries];
Integer[][] tempMVIntRows = new Integer[rowLength][maxNumberOfMVEntries];
Long[][] tempMVLongRows = new Long[rowLength][maxNumberOfMVEntries];
Expand All @@ -314,7 +314,7 @@ private List<GenericRow> createTestData() {
tempBigDecimalRows[i] = BASE_BIG_DECIMAL.add(BigDecimal.valueOf(1001));

// Avoid creating empty arrays.
int numMVElements = random.nextInt(maxNumberOfMVEntries - 1) + 1;
int numMVElements = random.nextInt(maxNumberOfMVEntries) + 1;
for (int j = 0; j < numMVElements; j++) {
tempMVIntRows[i][j] = 1001;
tempMVLongRows[i][j] = 1001L;
Expand All @@ -330,7 +330,7 @@ private List<GenericRow> createTestData() {
tempBigDecimalRows[i] = BASE_BIG_DECIMAL.add(BigDecimal.valueOf(i));

// Avoid creating empty arrays.
int numMVElements = random.nextInt(maxNumberOfMVEntries - 1) + 1;
int numMVElements = random.nextInt(maxNumberOfMVEntries) + 1;
for (int j = 0; j < numMVElements; j++) {
tempMVIntRows[i][j] = j;
tempMVLongRows[i][j] = (long) j;
Expand Down

0 comments on commit 1ac7fb3

Please sign in to comment.