This is an automated email from the ASF dual-hosted git repository.
pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new a01a5cf6ef4 [GSoC 2026] Fix Duplicated Subscription Path in
stale_cleaner.py (#39794)
a01a5cf6ef4 is described below
commit a01a5cf6ef433ad9cfd0ddd69f87420c49763a11
Author: HansMarcus01 <[email protected]>
AuthorDate: Mon Aug 17 15:59:02 2026 -0600
[GSoC 2026] Fix Duplicated Subscription Path in stale_cleaner.py (#39794)
* Feat: implementing active cleanup of orphaned subscriptions for the
`taxirides` topic.
* fix: Correct duplicated subscription path in stale_cleaner.py and update
stale_cleaner_test.py
---
.test-infra/tools/stale_cleaner.py | 3 +--
.test-infra/tools/test_stale_cleaner.py | 7 ++-----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/.test-infra/tools/stale_cleaner.py
b/.test-infra/tools/stale_cleaner.py
index 3c8b21c806d..d59af061ce9 100644
--- a/.test-infra/tools/stale_cleaner.py
+++ b/.test-infra/tools/stale_cleaner.py
@@ -350,8 +350,7 @@ class PubSubSubscriptionCleaner(StaleCleaner):
self.client = pubsub_v1.SubscriberClient()
print(f"{self.clock()} - Deleting PubSub subscription {resource_name}")
with self.client:
- subscription_path = self.client.subscription_path(self.project_id,
resource_name)
- self.client.delete_subscription(request={"subscription":
subscription_path})
+ self.client.delete_subscription(request={"subscription":
resource_name})
def clean_pubsub_topics():
""" Clean up stale PubSub topics in the specified GCP project.
diff --git a/.test-infra/tools/test_stale_cleaner.py
b/.test-infra/tools/test_stale_cleaner.py
index 08cdab39b85..5074661be3a 100644
--- a/.test-infra/tools/test_stale_cleaner.py
+++ b/.test-infra/tools/test_stale_cleaner.py
@@ -485,14 +485,11 @@ class PubSubSubscriptionCleanerTest(unittest.TestCase):
def test_delete_resource(self):
"""Test _delete_resource method."""
- sub_name = "test-sub-to-delete"
- subscription_path =
f"projects/{self.project_id}/subscriptions/{sub_name}"
- self.mock_subscriber_client.subscription_path.return_value =
subscription_path
+ subscription_path =
f"projects/{self.project_id}/subscriptions/test-subscription"
with SilencePrint():
- self.cleaner._delete_resource(sub_name)
+ self.cleaner._delete_resource(subscription_path)
-
self.mock_subscriber_client.subscription_path.assert_called_once_with(self.project_id,
sub_name)
self.mock_subscriber_client.delete_subscription.assert_called_once_with(
request={'subscription': subscription_path}
)