Skip to content

Commit ecd7227

Browse files
author
Takashi Matsuo
authored
fix(datastore): properly retry a flaky test (GoogleCloudPlatform#5543)
fixes GoogleCloudPlatform#5495
1 parent 97e7e82 commit ecd7227

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

datastore/cloud-client/admin_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
from concurrent.futures import TimeoutError
1415
import os
1516

1617
import backoff
@@ -41,7 +42,7 @@ def test_get_index(self):
4142
def test_list_index(self):
4243
assert admin.list_indexes(PROJECT)
4344

44-
@backoff.on_exception(backoff.expo, RetryError, max_tries=3)
45+
@backoff.on_exception(backoff.expo, (RetryError, TimeoutError), max_tries=3)
4546
def test_export_import_entities(self):
4647
response = admin.export_entities(PROJECT, "gs://" + BUCKET)
4748
assert response

datastore/cloud-client/snippets_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, *args, **kwargs):
3131
def cleanup(self):
3232
with self.batch():
3333
self.delete_multi(
34-
list(set([x.key for x in self.entities_to_delete]))
34+
list(set([x.key for x in self.entities_to_delete if x]))
3535
+ list(set(self.keys_to_delete))
3636
)
3737

0 commit comments

Comments
 (0)