Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vision: increase timeout for tests #3383

Merged
merged 6 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def purge_products_in_product_set(
# If force is not set to True, the service raises an exception.
force=force)

operation.result(timeout=120)
operation.result(timeout=300)

print('Deleted products in product set.')
# [END vision_product_search_purge_products_in_product_set]
Expand Down
2 changes: 1 addition & 1 deletion vision/cloud-client/product_search/product_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def purge_orphan_products(project_id, location, force):
# If force is not set to True, the service raises an exception.
force=force)

operation.result(timeout=120)
operation.result(timeout=300)

print('Orphan products deleted.')
# [END vision_product_search_purge_orphan_products]
Expand Down
2 changes: 2 additions & 0 deletions vision/cloud-client/product_search/product_search_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import os
from flaky import flaky

from product_search import get_similar_products_file, get_similar_products_uri

Expand All @@ -30,6 +31,7 @@
FILTER = 'style=womens'


@flaky(max_runs=5, min_passes=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If flaky makes the test pass, I'm quite happy to merge the PR because this flake is a different issue from the timeout.

However, it looks like this test is testing the result of the Vision API. Does it make sense to only test if the API call itself succeed? I'm totally fine if you just file a new issue and fix it with another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the output of the failures, it seems to be the API call isn't returning any results. So the backend seems to be flaky sometimes, I couldn't reproduce locally though, so I figured this should help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

def test_get_similar_products_file(capsys):
get_similar_products_file(
PROJECT_ID, LOCATION, PRODUCT_SET_ID, PRODUCT_CATEGORY, FILE_PATH_1,
Expand Down
1 change: 1 addition & 0 deletions vision/cloud-client/product_search/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest==5.3.2
flaky==3.6.1