Skip to content

Commit 2e448a7

Browse files
committed
address PR feedback
1 parent e11bb0e commit 2e448a7

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.librarian/generator-input/client-post-processing/firestore-integration.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ replacements:
564564
"freezegun",
565565
]
566566
count: 1
567+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17429):
568+
# Temporary post-processing rule to add pytest-xdist dependency.
569+
# Remove this once gapic-generator includes pytest-xdist by default.
567570
- paths: [
568571
packages/google-cloud-firestore/noxfile.py
569572
]
@@ -574,6 +577,7 @@ replacements:
574577
"pytest-asyncio",
575578
"six",
576579
"pyyaml",
580+
"pytest-xdist",
577581
]
578582
count: 1
579583
- paths: [
@@ -584,6 +588,54 @@ replacements:
584588
after: |
585589
"pytest-asyncio==0.21.2",
586590
count: 2
591+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17429):
592+
# Temporary post-processing rule to inject `-n auto` for Firestore parallel tests.
593+
# This rule should be removed once the generator template changes are released
594+
# and the generator version is updated in librarian.yaml.
595+
- paths: [
596+
packages/google-cloud-firestore/noxfile.py
597+
]
598+
before: |
599+
# Run py.test against the system tests\.
600+
if system_test_exists:
601+
session\.run\(
602+
"py.test",
603+
"--quiet",
604+
f"--junitxml=system_\{session\.python\}_sponge_log\.xml",
605+
system_test_path,
606+
\*session\.posargs,
607+
\)
608+
if system_test_folder_exists:
609+
session\.run\(
610+
"py.test",
611+
"--quiet",
612+
f"--junitxml=system_\{session\.python\}_sponge_log\.xml",
613+
system_test_folder_path,
614+
\*session\.posargs,
615+
\)
616+
after: |
617+
# Run py.test against the system tests.
618+
if system_test_exists:
619+
session.run(
620+
"py.test",
621+
"-n",
622+
"auto",
623+
"--quiet",
624+
f"--junitxml=system_{session.python}_sponge_log.xml",
625+
system_test_path,
626+
*session.posargs,
627+
)
628+
if system_test_folder_exists:
629+
session.run(
630+
"py.test",
631+
"-n",
632+
"auto",
633+
"--quiet",
634+
f"--junitxml=system_{session.python}_sponge_log.xml",
635+
system_test_folder_path,
636+
*session.posargs,
637+
)
638+
count: 1
587639
- paths: [
588640
"packages/google-cloud-firestore/docs/conf.py",
589641
]

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,6 +2336,10 @@ 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.
23392343
sleep(0.2)
23402344

23412345
# Setup listener
@@ -2384,6 +2388,10 @@ def on_snapshot(docs, changes, read_time):
23842388

23852389
collection_ref.on_snapshot(on_snapshot)
23862390

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.
23872395
# delay here so initial on_snapshot occurs and isn't combined with set
23882396
sleep(0.2)
23892397

@@ -2411,6 +2419,10 @@ def test_watch_query(client, cleanup, database):
24112419
doc_ref.set({"first": "Jane", "last": "Doe", "born": 1900})
24122420
cleanup(doc_ref.delete)
24132421

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.
24142426
sleep(0.2)
24152427

24162428
# Setup listener
@@ -2806,6 +2818,10 @@ def on_snapshot(docs, changes, read_time):
28062818
on_snapshot.failed = None
28072819
query_ref.on_snapshot(on_snapshot)
28082820

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.
28092825
sleep(0.2)
28102826

28112827
doc_ref1.set({"first": "Ada", "last": "Lovelace", "born": 1815})

0 commit comments

Comments
 (0)