Skip to content

Commit

Permalink
Drop orphan test.
Browse files Browse the repository at this point in the history
Closes: #2080.
  • Loading branch information
tseaver committed Sep 15, 2016
1 parent a92d69f commit 8a9dc64
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions system_tests/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,40 +262,3 @@ def test_subscription_iam_policy(self):
policy.viewers.add(policy.user('jjg@google.com'))
new_policy = subscription.set_iam_policy(policy)
self.assertEqual(new_policy.viewers, policy.viewers)

# This test is ultra-flaky. See:
# https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2080
@unittest.expectedFailure
def test_fetch_delete_subscription_w_deleted_topic(self):
from google.cloud.iterator import MethodIterator
TO_DELETE = 'delete-me' + unique_resource_id('-')
ORPHANED = 'orphaned' + unique_resource_id('-')
topic = Config.CLIENT.topic(TO_DELETE)
topic.create()
subscription = topic.subscription(ORPHANED)
subscription.create()
topic.delete()

def _fetch():
return list(MethodIterator(Config.CLIENT.list_subscriptions))

def _found_orphan(result):
names = [subscription.name for subscription in result]
return ORPHANED in names

retry_until_found_orphan = RetryResult(_found_orphan)
all_subs = retry_until_found_orphan(_fetch)()

created = [subscription for subscription in all_subs
if subscription.name == ORPHANED]
self.assertEqual(len(created), 1)
orphaned = created[0]
self.to_delete.append(orphaned)

def _no_topic(instance):
return instance.topic is None

retry_until_no_topic = RetryInstanceState(_no_topic)
retry_until_no_topic(orphaned.reload)()

self.assertTrue(orphaned.topic is None)

0 comments on commit 8a9dc64

Please sign in to comment.