Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 42ab1dc

Browse files
committed
test: make bulk mutate it less flaky
Change-Id: I13871cd3a6903eb07ecc272df5bff0519b256816
1 parent 77952d2 commit 42ab1dc

1 file changed

Lines changed: 11 additions & 18 deletions

File tree

  • google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,26 +232,19 @@ public void testManyMutationsOnAuthorizedView() throws IOException, InterruptedE
232232
.first()
233233
.call(Query.create(testEnvRule.env().getTableId()).rowKey(rowPrefix + "test-key"));
234234
assertThat(row.getCells()).hasSize(100002);
235-
}
236235

237-
// We should not be able to mutate rows outside the authorized view
238-
try {
239-
try (BigtableDataClient client = BigtableDataClient.create(settings);
240-
Batcher<RowMutationEntry, Void> batcherOutsideAuthorizedView =
241-
client.newBulkMutationBatcher(
242-
AuthorizedViewId.of(
243-
testEnvRule.env().getTableId().getTableId(), testAuthorizedView.getId()))) {
244-
String keyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view";
245-
RowMutationEntry rowMutationEntry = RowMutationEntry.create(keyOutsideAuthorizedView);
246-
rowMutationEntry.setCell(
247-
testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "test-value");
248-
@SuppressWarnings("UnusedVariable")
249-
ApiFuture<Void> ignored = batcherOutsideAuthorizedView.add(rowMutationEntry);
250-
batcherOutsideAuthorizedView.flush();
236+
// We should not be able to mutate rows outside the authorized view
237+
String keyOutsideAuthorizedView = UUID.randomUUID() + "-outside-authorized-view";
238+
RowMutationEntry rowMutationEntry = RowMutationEntry.create(keyOutsideAuthorizedView);
239+
rowMutationEntry.setCell(
240+
testEnvRule.env().getFamilyId(), AUTHORIZED_VIEW_COLUMN_QUALIFIER, "test-value");
241+
try {
242+
ApiFuture<Void> ignored = batcher.add(rowMutationEntry);
243+
batcher.flush();
244+
fail("Should not be able to apply bulk mutation on rows outside authorized view");
245+
} catch (Exception e) {
246+
// ignore
251247
}
252-
fail("Should not be able to apply bulk mutation on rows outside authorized view");
253-
} catch (Exception e) {
254-
// Ignore.
255248
}
256249

257250
testEnvRule

0 commit comments

Comments
 (0)