Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b43e62

Browse files
Takashi Matsuocrwilcox
andauthored
[firestore] fix: mark 3 tests as flaky (GoogleCloudPlatform#3295)
fixes GoogleCloudPlatform#3131 These tests are testing sample code that has `sleep(1)` in it. The test is naturally flaky, but when I run the test 100 times, they all pass, so they are somewhat stable. I believe it will mitigate the flakiness a lot just by retrying 3 times. If it doesn't work, we'll probably need to make a fundamental fix to remove `sleep(1)` calls. Co-authored-by: Christopher Wilcox <[email protected]>
1 parent 4c2ec33 commit 4b43e62

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pytest==5.3.2
2+
flaky==3.6.1

firestore/cloud-client/snippets_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,22 @@ def test_cursor_multiple_conditions():
267267
snippets.cursor_multiple_conditions()
268268

269269

270+
@pytest.mark.flaky(max_runs=3)
270271
def test_listen_document(capsys):
271272
snippets.listen_document()
272273
out, _ = capsys.readouterr()
273274
assert 'Received document snapshot: SF' in out
274275

275276

277+
@pytest.mark.flaky(max_runs=3)
276278
def test_listen_multiple(capsys):
277279
snippets.listen_multiple()
278280
out, _ = capsys.readouterr()
279281
assert 'Current cities in California:' in out
280282
assert 'SF' in out
281283

282284

285+
@pytest.mark.flaky(max_runs=3)
283286
def test_listen_for_changes(capsys):
284287
snippets.listen_for_changes()
285288
out, _ = capsys.readouterr()

0 commit comments

Comments
 (0)