Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
tests(datastore): fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKevJames committed Jul 9, 2019
1 parent db4994e commit d22e6de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datastore/tests/integration/query_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import requests

from gcloud.rest.datastore import Datastore
Expand Down Expand Up @@ -36,6 +38,10 @@ def test_query(creds, kind, project):
]
ds.commit(mutations, transaction=transaction, session=s)

# TODO: figure out why this is flaky without the sleep
# Seems to only be flaky intermittently in py2.
time.sleep(2)

after = ds.runQuery(query, session=s)
assert len(after.entity_results) == num_results + 2

Expand Down Expand Up @@ -65,5 +71,9 @@ def test_gql_query(creds, kind, project):
]
ds.commit(mutations, transaction=transaction, session=s)

# TODO: figure out why this is flaky without the sleep
# Seems to only be flaky intermittently in py2.
time.sleep(2)

after = ds.runQuery(query, session=s)
assert len(after.entity_results) == num_results + 3

0 comments on commit d22e6de

Please sign in to comment.