Skip to content

Commit a51257a

Browse files
author
Takashi Matsuo
committed
fix flask_app_test too
1 parent e212361 commit a51257a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

datastore/cloud-ndb/flask_app_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
import uuid
1616

17-
import pytest
1817

18+
import backoff
19+
import pytest
1920
from google.cloud import ndb
2021

2122
import flask_app
@@ -39,9 +40,13 @@ def test_index(test_book):
3940
flask_app.app.testing = True
4041
client = flask_app.app.test_client()
4142

42-
r = client.get('/')
43-
assert r.status_code == 200
44-
assert test_book.title in r.data.decode('utf-8')
43+
@backoff.on_exception(backoff.expo, AssertionError, max_time=60)
44+
def eventually_consistent_test():
45+
r = client.get('/')
46+
assert r.status_code == 200
47+
assert test_book.title in r.data.decode('utf-8')
48+
49+
eventually_consistent_test()
4550

4651

4752
def test_ndb_wsgi_middleware():

0 commit comments

Comments
 (0)