From 8a9dc64325151d783a59b1131c3c6561b1d2a615 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Tue, 6 Sep 2016 13:14:13 -0400 Subject: [PATCH] Drop orphan test. Closes: #2080. --- system_tests/pubsub.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/system_tests/pubsub.py b/system_tests/pubsub.py index acde3ef097b0..2d512dd38002 100644 --- a/system_tests/pubsub.py +++ b/system_tests/pubsub.py @@ -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)