Skip to content

Commit bcb9391

Browse files
nnegreylesv
authored andcommitted
samples: dialogflow: add and increase timeout to document creation for tests (#1996)
Co-authored-by: Les Vogel <lesv@users.noreply.github.com>
1 parent 8cbfbec commit bcb9391

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dialogflow/snippets/src/main/java/com/example/dialogflow/DocumentManagement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.google.common.collect.Lists;
2626

2727
import java.util.List;
28+
import java.util.concurrent.TimeUnit;
2829

2930
public class DocumentManagement {
3031
// [START dialogflow_list_document]
@@ -86,7 +87,7 @@ public static Document createDocument(
8687
.build();
8788
OperationFuture<Document, KnowledgeOperationMetadata> response =
8889
documentsClient.createDocumentAsync(createDocumentRequest);
89-
Document createdDocument = response.get();
90+
Document createdDocument = response.get(120, TimeUnit.SECONDS);
9091
System.out.format("Created Document:\n");
9192
System.out.format(" - Display Name: %s\n", createdDocument.getDisplayName());
9293
System.out.format(" - Knowledge ID: %s\n", createdDocument.getName());

0 commit comments

Comments
 (0)