Skip to content

Commit 6eb1812

Browse files
committed
wip
1 parent 104bb5a commit 6eb1812

3 files changed

Lines changed: 14 additions & 35 deletions

File tree

packages/google-cloud-firestore/noxfile.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
"pytest-asyncio==0.21.2",
8383
"six",
8484
"pyyaml",
85-
"pytest-xdist",
8685
]
8786
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
8887
SYSTEM_TEST_DEPENDENCIES: List[str] = []
@@ -403,8 +402,6 @@ def system(session):
403402
if system_test_exists:
404403
session.run(
405404
"py.test",
406-
"-n",
407-
"auto",
408405
"--quiet",
409406
f"--junitxml=system_{session.python}_sponge_log.xml",
410407
system_test_path,
@@ -413,8 +410,6 @@ def system(session):
413410
if system_test_folder_exists:
414411
session.run(
415412
"py.test",
416-
"-n",
417-
"auto",
418413
"--quiet",
419414
f"--junitxml=system_{session.python}_sponge_log.xml",
420415
system_test_folder_path,

packages/google-cloud-firestore/tests/system/test__helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
MISSING_DOCUMENT = "No document to update: "
1717
DOCUMENT_EXISTS = "Document already exists: "
1818
ENTERPRISE_MODE_ERROR = "only allowed on ENTERPRISE mode"
19-
UNIQUE_RESOURCE_ID = unique_resource_id("-") + "-" + str(os.getpid())
19+
UNIQUE_RESOURCE_ID = unique_resource_id("-")
2020
EMULATOR_CREDS = EmulatorCreds()
2121
FIRESTORE_EMULATOR = os.environ.get(_FIRESTORE_EMULATOR_HOST) is not None
2222
FIRESTORE_OTHER_DB = os.environ.get("SYSTEM_TESTS_DATABASE", "system-tests-named-db")

packages/google-cloud-firestore/tests/system/test_system.py

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,11 +2336,7 @@ def test_watch_document(client, cleanup, database):
23362336
doc_ref.set({"first": "Jane", "last": "Doe", "born": 1900})
23372337
cleanup(doc_ref.delete)
23382338

2339-
# TODO(https://github.com/googleapis/google-cloud-python/issues/17428):
2340-
# Investigate why these sleep/polling delays are needed for listener tests.
2341-
# Having arbitrary delays is fragile and can lead to flakiness.
2342-
# Explore event-driven synchronization.
2343-
sleep(0.2)
2339+
sleep(1)
23442340

23452341
# Setup listener
23462342
def on_snapshot(docs, changes, read_time):
@@ -2353,12 +2349,12 @@ def on_snapshot(docs, changes, read_time):
23532349
# Alter document
23542350
doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815})
23552351

2356-
sleep(0.2)
2352+
sleep(1)
23572353

2358-
for _ in range(50):
2354+
for _ in range(10):
23592355
if on_snapshot.called_count > 0:
23602356
break
2361-
sleep(0.2)
2357+
sleep(1)
23622358

23632359
if on_snapshot.called_count not in (1, 2):
23642360
raise AssertionError(
@@ -2388,19 +2384,15 @@ def on_snapshot(docs, changes, read_time):
23882384

23892385
collection_ref.on_snapshot(on_snapshot)
23902386

2391-
# TODO(https://github.com/googleapis/google-cloud-python/issues/17428):
2392-
# Investigate why these sleep/polling delays are needed for listener tests.
2393-
# Having arbitrary delays is fragile and can lead to flakiness.
2394-
# Explore event-driven synchronization.
23952387
# delay here so initial on_snapshot occurs and isn't combined with set
2396-
sleep(0.2)
2388+
sleep(1)
23972389

23982390
doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815})
23992391

2400-
for _ in range(50):
2392+
for _ in range(10):
24012393
if on_snapshot.born == 1815:
24022394
break
2403-
sleep(0.2)
2395+
sleep(1)
24042396

24052397
if on_snapshot.born != 1815:
24062398
raise AssertionError(
@@ -2419,11 +2411,7 @@ def test_watch_query(client, cleanup, database):
24192411
doc_ref.set({"first": "Jane", "last": "Doe", "born": 1900})
24202412
cleanup(doc_ref.delete)
24212413

2422-
# TODO(https://github.com/googleapis/google-cloud-python/issues/17428):
2423-
# Investigate why these sleep/polling delays are needed for listener tests.
2424-
# Having arbitrary delays is fragile and can lead to flakiness.
2425-
# Explore event-driven synchronization.
2426-
sleep(0.2)
2414+
sleep(1)
24272415

24282416
# Setup listener
24292417
def on_snapshot(docs, changes, read_time):
@@ -2441,10 +2429,10 @@ def on_snapshot(docs, changes, read_time):
24412429
# Alter document
24422430
doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815})
24432431

2444-
for _ in range(50):
2432+
for _ in range(10):
24452433
if on_snapshot.called_count == 1:
24462434
return
2447-
sleep(0.2)
2435+
sleep(1)
24482436

24492437
if on_snapshot.called_count != 1:
24502438
raise AssertionError(
@@ -2818,11 +2806,7 @@ def on_snapshot(docs, changes, read_time):
28182806
on_snapshot.failed = None
28192807
query_ref.on_snapshot(on_snapshot)
28202808

2821-
# TODO(https://github.com/googleapis/google-cloud-python/issues/17428):
2822-
# Investigate why these sleep/polling delays are needed for listener tests.
2823-
# Having arbitrary delays is fragile and can lead to flakiness.
2824-
# Explore event-driven synchronization.
2825-
sleep(0.2)
2809+
sleep(1)
28262810

28272811
doc_ref1.set({"first": "Ada", "last": "Lovelace", "born": 1815})
28282812
cleanup(doc_ref1.delete)
@@ -2839,10 +2823,10 @@ def on_snapshot(docs, changes, read_time):
28392823
doc_ref5.set({"first": "Ada", "last": "lovelace", "born": 1815})
28402824
cleanup(doc_ref5.delete)
28412825

2842-
for _ in range(50):
2826+
for _ in range(10):
28432827
if on_snapshot.last_doc_count == 5:
28442828
break
2845-
sleep(0.2)
2829+
sleep(1)
28462830

28472831
if on_snapshot.failed:
28482832
raise on_snapshot.failed

0 commit comments

Comments
 (0)