-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pubsub system test: test_fetch_delete_subscription_w_deleted_topic does not see orphan w/o topic #2080
Comments
@tseaver I just created the |
Again yesterday. |
W00t! We have two passing post-merge builds after the merge of #2106: |
w00t! |
@tmatsuo Has there been some recently-deployed change to the Pubsub API which would cause this failure to go from "flaky" to "fails routinely"? Our current backoff ends up polling for four minutes, trying to get the @dhermes, @daspecster If @tmatsuo doesn't know / suspect any back-end change which would explain the failures, I propose we drop this particular testcase: we have unittests in place which cover the oddball case, and we need to have our build stay green. |
I'm unclear on how important this test case is, though hope we can sort out the backend's issues without having to ditch the system test (the more the merrier). |
@tseaver shouldn't we leave this open? |
@tseaver As of the latest build the error has stopped occurring, which has led to "unexpected success". To make this more hilarious, in Python 2 vs. 3, that means a different status code with I've tried to repro the import unittest
class TestNothing(unittest.TestCase):
@unittest.expectedFailure
def test_it(self):
self.assertTrue(False)
def main():
suite = unittest.TestSuite()
tests = unittest.defaultTestLoader.loadTestsFromTestCase(
TestNothing)
suite.addTest(tests)
test_result = unittest.TextTestRunner(verbosity=2).run(suite)
print('test_result.wasSuccessful():')
print(test_result.wasSuccessful())
if __name__ == '__main__':
main() |
Same fail but not really fail again: https://travis-ci.org/GoogleCloudPlatform/gcloud-python/builds/157238601 |
I'm in favor of just dropping the test altogether (as #2215 did originally). |
Sorry for the late reply. What does the test do? Maybe I can ask a core engineer if something has changed. |
@tmatsuo it creates a topic, and a subscription to it, then deletes the topic. It then tries to verify that the same subscription (when returned from What we see is that the orphaned subscription is not showing that special value, even after an extremely long retry/backoff cycle (up to four minutes or so). |
Does it always fail now, or it is still flaky (flakier than before)? |
It failed for like 10 days straight and now has succeeded for about 5 days straight |
Thanks, asked the engineering team about it |
If we merge #2248, we can still have the back-end guys experiment with the test by setting the appropriate environment variable. E.g.: $ git clone git@github.com:GoogleCloudPlatform/google-cloud-python
$ cd google-cloud-python
$ GOOGLE_CLOUD_RUN_FLAKY_TESTS=1 tox -e system-tests |
I did some sleuthing and found out why the unexpected success causes a failure in Python 3 but not Python 2. def wasSuccessful(self):
return len(self.failures) == len(self.errors) == 0 became def wasSuccessful(self):
return ((len(self.failures) == len(self.errors) == 0) and
(not hasattr(self, 'unexpectedSuccesses') or
len(self.unexpectedSuccesses) == 0)) |
Potential "fix" diff --git a/system_tests/run_system_test.py b/system_tests/run_system_test.py
index 4ee50f9..4bb752c 100644
--- a/system_tests/run_system_test.py
+++ b/system_tests/run_system_test.py
@@ -70,6 +70,8 @@ def run_module_tests(module_name, ignore_requirements=False):
# Run tests.
test_result = unittest.TextTestRunner(verbosity=2).run(suite)
+ # NOTE: Erase the unexpected successes.
+ test_result.unexpectedSuccesses[:] = []
# Exit if not successful.
if not test_result.wasSuccessful():
raise FailedSystemTestModule(module_name) Though it seems like the test succeeds to frequently now we should just remove |
When running
since |
PR #2248 deleted the flaky test. |
From: https://travis-ci.org/GoogleCloudPlatform/gcloud-python/builds/151011241#L822
The text was updated successfully, but these errors were encountered: