diff --git a/packages/google-cloud-firestore/noxfile.py b/packages/google-cloud-firestore/noxfile.py index 80fe70fa5798..ef340c48888a 100644 --- a/packages/google-cloud-firestore/noxfile.py +++ b/packages/google-cloud-firestore/noxfile.py @@ -82,7 +82,6 @@ "pytest-asyncio==0.21.2", "six", "pyyaml", - "pytest-xdist", ] SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [] SYSTEM_TEST_DEPENDENCIES: List[str] = [] @@ -403,8 +402,6 @@ def system(session): if system_test_exists: session.run( "py.test", - "-n", - "auto", "--quiet", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_path, @@ -413,8 +410,6 @@ def system(session): if system_test_folder_exists: session.run( "py.test", - "-n", - "auto", "--quiet", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_folder_path, diff --git a/packages/google-cloud-firestore/tests/system/test__helpers.py b/packages/google-cloud-firestore/tests/system/test__helpers.py index 228bd0e4362a..83dd476602f2 100644 --- a/packages/google-cloud-firestore/tests/system/test__helpers.py +++ b/packages/google-cloud-firestore/tests/system/test__helpers.py @@ -16,7 +16,7 @@ MISSING_DOCUMENT = "No document to update: " DOCUMENT_EXISTS = "Document already exists: " ENTERPRISE_MODE_ERROR = "only allowed on ENTERPRISE mode" -UNIQUE_RESOURCE_ID = unique_resource_id("-") + "-" + str(os.getpid()) +UNIQUE_RESOURCE_ID = unique_resource_id("-") EMULATOR_CREDS = EmulatorCreds() FIRESTORE_EMULATOR = os.environ.get(_FIRESTORE_EMULATOR_HOST) is not None FIRESTORE_OTHER_DB = os.environ.get("SYSTEM_TESTS_DATABASE", "system-tests-named-db") diff --git a/packages/google-cloud-firestore/tests/system/test_system.py b/packages/google-cloud-firestore/tests/system/test_system.py index fe475206d37f..bcdc96c10f63 100644 --- a/packages/google-cloud-firestore/tests/system/test_system.py +++ b/packages/google-cloud-firestore/tests/system/test_system.py @@ -2336,11 +2336,7 @@ def test_watch_document(client, cleanup, database): doc_ref.set({"first": "Jane", "last": "Doe", "born": 1900}) cleanup(doc_ref.delete) - # TODO(https://github.com/googleapis/google-cloud-python/issues/17428): - # Investigate why these sleep/polling delays are needed for listener tests. - # Having arbitrary delays is fragile and can lead to flakiness. - # Explore event-driven synchronization. - sleep(0.2) + sleep(1) # Setup listener def on_snapshot(docs, changes, read_time): @@ -2353,12 +2349,12 @@ def on_snapshot(docs, changes, read_time): # Alter document doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815}) - sleep(0.2) + sleep(1) - for _ in range(50): + for _ in range(10): if on_snapshot.called_count > 0: break - sleep(0.2) + sleep(1) if on_snapshot.called_count not in (1, 2): raise AssertionError( @@ -2388,19 +2384,15 @@ def on_snapshot(docs, changes, read_time): collection_ref.on_snapshot(on_snapshot) - # TODO(https://github.com/googleapis/google-cloud-python/issues/17428): - # Investigate why these sleep/polling delays are needed for listener tests. - # Having arbitrary delays is fragile and can lead to flakiness. - # Explore event-driven synchronization. # delay here so initial on_snapshot occurs and isn't combined with set - sleep(0.2) + sleep(1) doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815}) - for _ in range(50): + for _ in range(10): if on_snapshot.born == 1815: break - sleep(0.2) + sleep(1) if on_snapshot.born != 1815: raise AssertionError( @@ -2419,11 +2411,7 @@ def test_watch_query(client, cleanup, database): doc_ref.set({"first": "Jane", "last": "Doe", "born": 1900}) cleanup(doc_ref.delete) - # TODO(https://github.com/googleapis/google-cloud-python/issues/17428): - # Investigate why these sleep/polling delays are needed for listener tests. - # Having arbitrary delays is fragile and can lead to flakiness. - # Explore event-driven synchronization. - sleep(0.2) + sleep(1) # Setup listener def on_snapshot(docs, changes, read_time): @@ -2441,10 +2429,10 @@ def on_snapshot(docs, changes, read_time): # Alter document doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815}) - for _ in range(50): + for _ in range(10): if on_snapshot.called_count == 1: return - sleep(0.2) + sleep(1) if on_snapshot.called_count != 1: raise AssertionError( @@ -2818,11 +2806,7 @@ def on_snapshot(docs, changes, read_time): on_snapshot.failed = None query_ref.on_snapshot(on_snapshot) - # TODO(https://github.com/googleapis/google-cloud-python/issues/17428): - # Investigate why these sleep/polling delays are needed for listener tests. - # Having arbitrary delays is fragile and can lead to flakiness. - # Explore event-driven synchronization. - sleep(0.2) + sleep(1) doc_ref1.set({"first": "Ada", "last": "Lovelace", "born": 1815}) cleanup(doc_ref1.delete) @@ -2839,10 +2823,10 @@ def on_snapshot(docs, changes, read_time): doc_ref5.set({"first": "Ada", "last": "lovelace", "born": 1815}) cleanup(doc_ref5.delete) - for _ in range(50): + for _ in range(10): if on_snapshot.last_doc_count == 5: break - sleep(0.2) + sleep(1) if on_snapshot.failed: raise on_snapshot.failed