Skip to content

Commit 27ee41e

Browse files
bigtable (docs): add multiple attempts for change stream test (#8929)
* bigtable (docs): add multiple attempts for change stream test * use multiple attempts rule * update waiting comment
1 parent 5f83fd5 commit 27ee41e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

bigtable/beam/change-streams/src/test/java/ChangeStreamsHelloWorldTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919

2020
import com.google.cloud.bigtable.data.v2.BigtableDataClient;
2121
import com.google.cloud.bigtable.data.v2.models.RowMutation;
22+
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
2223
import java.io.ByteArrayOutputStream;
2324
import java.io.IOException;
2425
import java.io.PrintStream;
2526
import java.util.UUID;
2627
import org.junit.Before;
2728
import org.junit.BeforeClass;
29+
import org.junit.Rule;
2830
import org.junit.Test;
2931

3032
public class ChangeStreamsHelloWorldTest {
33+
@Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
3134

3235
// This table needs to be created manually before running the test since there is no API to create
3336
// change-stream enabled tables yet. For java-docs-samples, the table should already be created,
@@ -84,7 +87,7 @@ public void testChangeStreamsHelloWorld() throws IOException, InterruptedExcepti
8487

8588
dataClient.mutateRow(RowMutation.create(TABLE_ID, rowKey).deleteRow());
8689

87-
// Wait for change to be captured.
90+
// Wait for written data to propagate into the Bigtable change stream.
8891
Thread.sleep(15 * 1000);
8992

9093
String output = bout.toString();

0 commit comments

Comments
 (0)