Skip to content

Commit

Permalink
test(samples): prevent failure in nightly run by adding retry (#392)
Browse files Browse the repository at this point in the history
Fixes #381  ☕️
  • Loading branch information
munkhuushmgl committed Feb 19, 2021
1 parent 31dce1a commit b16f681
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vision/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>1.94.0</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.Storage.BlobListOption;
import com.google.cloud.storage.StorageOptions;
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down Expand Up @@ -58,6 +60,9 @@ public void tearDown() {
System.setOut(originalPrintStream);
}

@Rule
public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);

@Test
public void testDocumentText() throws Exception {
// Act
Expand Down

0 comments on commit b16f681

Please sign in to comment.