Skip to content

Commit

Permalink
chore: added retry for flaky test (#391)
Browse files Browse the repository at this point in the history
* chore: added retry for flaky test

* lint

* added missing dependency
  • Loading branch information
munkhuushmgl authored and Shabirmean committed Nov 15, 2022
1 parent cc7f742 commit d78d2a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dialogflow/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
</dependency>
<!-- [END dialogflow_install_with_bom] -->

<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>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
import com.google.cloud.dialogflow.v2beta1.KnowledgeBase;
import com.google.cloud.dialogflow.v2beta1.KnowledgeBasesClient;
import com.google.cloud.dialogflow.v2beta1.ProjectName;
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down Expand Up @@ -84,6 +86,9 @@ public void tearDown() throws IOException {
System.setOut(null);
}

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

@Test
public void testCreateDocument() throws Exception {
DocumentManagement.createDocument(
Expand Down

0 comments on commit d78d2a6

Please sign in to comment.