From 10cd0a18b470a5ca423bdbfbf3129009ca100325 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Sat, 2 May 2020 01:25:08 +0000 Subject: [PATCH] [dialogflow] fix: marking a test with flaky fixes #3490 --- dialogflow/cloud-client/create_document_test.py | 1 + dialogflow/cloud-client/document_management.py | 2 +- dialogflow/cloud-client/requirements-test.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dialogflow/cloud-client/create_document_test.py b/dialogflow/cloud-client/create_document_test.py index 6e5b5bd6585..d6474a42255 100644 --- a/dialogflow/cloud-client/create_document_test.py +++ b/dialogflow/cloud-client/create_document_test.py @@ -47,6 +47,7 @@ def setup_teardown(): client.delete_knowledge_base(knowledge_base_path, force=True) +@pytest.mark.flaky(max_runs=3, min_passes=1) def test_create_document(capsys): document_management.create_document( PROJECT_ID, pytest.KNOWLEDGE_BASE_ID, DOCUMENT_DISPLAY_NAME, diff --git a/dialogflow/cloud-client/document_management.py b/dialogflow/cloud-client/document_management.py index b5e1c91d84f..c7ed6f76f00 100644 --- a/dialogflow/cloud-client/document_management.py +++ b/dialogflow/cloud-client/document_management.py @@ -60,7 +60,7 @@ def create_document(project_id, knowledge_base_id, display_name, mime_type, response = client.create_document(knowledge_base_path, document) print('Waiting for results...') - document = response.result(timeout=90) + document = response.result(timeout=120) print('Created Document:') print(' - Display Name: {}'.format(document.display_name)) print(' - Knowledge ID: {}'.format(document.name)) diff --git a/dialogflow/cloud-client/requirements-test.txt b/dialogflow/cloud-client/requirements-test.txt index 781d4326c94..1b569cb4f2c 100644 --- a/dialogflow/cloud-client/requirements-test.txt +++ b/dialogflow/cloud-client/requirements-test.txt @@ -1 +1,2 @@ pytest==5.3.2 +flaky==3.6.1