8000 fix(dataflow): use gcloud for teardown (#4504) · code4ward/python-docs-samples@1582169 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1582169

Browse files
author
Takashi Matsuo
authored
fix(dataflow): use gcloud for teardown (GoogleCloudPlatform#4504)
fixes GoogleCloudPlatform#4492 I know this is a terrible workaround, but this test has been failing for a week. I'd like to make our builds green first.
1 parent 77d2be4 commit 1582169

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dataflow/flex-templates/streaming_beam/streaming_beam_test.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ def topic_path():
4040
pass
4141
topic = publisher_client.create_topic(topic_path)
4242
yield topic.name
43-
publisher_client.delete_topic(topic_path)
43+
# Due to the pinned library dependencies in apache-beam, client
44+
# library throws an error upon deletion.
45+
# We use gcloud for a workaround. See also:
46+
# https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4492
47+
sp.check_call(
48+
['gcloud', 'pubsub', '--project', PROJECT, 'topics', 'delete', TOPIC])
4449

4550

4651
@pytest.fixture
@@ -53,7 +58,14 @@ def subscription_path(topic_path):
5358
pass
5459
subscription = subscriber.create_subscription(subscription_path, topic_path)
5560
yield subscription.name
56-
subscriber.delete_subscription(subscription_path)
61+
62+
# Due to the pinned library dependencies in apache-beam, client
63+
# library throws an error upon deletion.
64+
# We use gcloud for a workaround. See also:
65+
# https://github.com/GoogleCloudPlatform/python-docs-samples/issues/4492
66+
sp.check_call(
67+
['gcloud', 'pubsub', '--project', PROJECT, 'subscriptions', 'delete',
68+
SUBSCRIPTION])
5769

5870

5971
@pytest.fixture

0 commit comments

Comments
 (0)
0