Skip to content

Commit 4236143

Browse files
authored
fix(bigquery): fix flaky testInsertAll by adding insert IDs (#13414)
b/495487323
1 parent 7b5efb5 commit 4236143

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it

java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2983,8 +2983,8 @@ void testInsertAll() throws IOException {
29832983
builder2.put("NumericField", new BigDecimal("123456789.123456789"));
29842984
InsertAllRequest request =
29852985
InsertAllRequest.newBuilder(tableInfo.getTableId())
2986-
.addRow(builder1.build())
2987-
.addRow(builder2.build())
2986+
.addRow(UUID.randomUUID().toString(), builder1.build())
2987+
.addRow(UUID.randomUUID().toString(), builder2.build())
29882988
.build();
29892989
InsertAllResponse response = bigquery.insertAll(request);
29902990
assertFalse(response.hasErrors());
@@ -3042,8 +3042,8 @@ void testInsertAllWithSuffix() throws InterruptedException {
30423042
builder2.put("NumericField", new BigDecimal("123456789.123456789"));
30433043
InsertAllRequest request =
30443044
InsertAllRequest.newBuilder(tableInfo.getTableId())
3045-
.addRow(builder1.build())
3046-
.addRow(builder2.build())
3045+
.addRow(UUID.randomUUID().toString(), builder1.build())
3046+
.addRow(UUID.randomUUID().toString(), builder2.build())
30473047
.setTemplateSuffix("_suffix")
30483048
.build();
30493049
InsertAllResponse response = bigquery.insertAll(request);
@@ -3116,9 +3116,9 @@ void testInsertAllWithErrors() {
31163116
builder3.put("BytesField", BYTES_BASE64);
31173117
InsertAllRequest request =
31183118
InsertAllRequest.newBuilder(tableInfo.getTableId())
3119-
.addRow(builder1.build())
3120-
.addRow(builder2.build())
3121-
.addRow(builder3.build())
3119+
.addRow(UUID.randomUUID().toString(), builder1.build())
3120+
.addRow(UUID.randomUUID().toString(), builder2.build())
3121+
.addRow(UUID.randomUUID().toString(), builder3.build())
31223122
.setSkipInvalidRows(true)
31233123
.build();
31243124
InsertAllResponse response = bigquery.insertAll(request);

0 commit comments

Comments
 (0)