Skip to content

Commit d78d2a6

Browse files
munkhuushmglShabirmean
authored andcommitted
chore: added retry for flaky test (#391)
* chore: added retry for flaky test * lint * added missing dependency
1 parent cc7f742 commit d78d2a6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dialogflow/snippets/pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
</dependency>
4545
<!-- [END dialogflow_install_with_bom] -->
4646

47+
<dependency>
48+
<groupId>com.google.cloud</groupId>
49+
<artifactId>google-cloud-core</artifactId>
50+
<version>1.94.0</version>
51+
<scope>test</scope>
52+
<classifier>tests</classifier>
53+
</dependency>
54+
55+
4756
<dependency>
4857
<groupId>junit</groupId>
4958
<artifactId>junit</artifactId>

dialogflow/snippets/src/test/java/com/example/dialogflow/CreateDocumentTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
import com.google.cloud.dialogflow.v2beta1.KnowledgeBase;
2424
import com.google.cloud.dialogflow.v2beta1.KnowledgeBasesClient;
2525
import com.google.cloud.dialogflow.v2beta1.ProjectName;
26+
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
2627
import java.io.ByteArrayOutputStream;
2728
import java.io.IOException;
2829
import java.io.PrintStream;
2930
import java.util.UUID;
3031
import org.junit.After;
3132
import org.junit.Before;
3233
import org.junit.BeforeClass;
34+
import org.junit.Rule;
3335
import org.junit.Test;
3436
import org.junit.runner.RunWith;
3537
import org.junit.runners.JUnit4;
@@ -84,6 +86,9 @@ public void tearDown() throws IOException {
8486
System.setOut(null);
8587
}
8688

89+
@Rule
90+
public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
91+
8792
@Test
8893
public void testCreateDocument() throws Exception {
8994
DocumentManagement.createDocument(

0 commit comments

Comments
 (0)