From 7d8d743d8e168f64fa893c975d7301507d4985d8 Mon Sep 17 00:00:00 2001 From: Amrith Kumar Date: Sat, 10 Sep 2016 12:33:42 -0400 Subject: [PATCH] Skip 'eject valid master' replication test There is a test to eject a valid master during replication that is failing more and more often in the scenario tests. Basically the eject will only work if the heartbeat from the current master is more than a minute old. This shouldn't happen in the scenario test run, but it does - quite often. Since this is consuming a large amount of gate resources, and the bug isn't that onerous (but is probably hard to fix), the current 'eject valid master' test will be turned off until the fix lands. The scenario test will print out the bug number during each run as a reminder (using the new SkipKnownBug method). Co-Authored-By: Peter Stachowski Co-Authored-By: Amrith Kumar Author: Peter Stachowski Change-Id: Ia543da551ad4394d4964541f9db474e0792b9337 Related-Bug: #1622014 --- trove/tests/scenario/runners/__init__.py | 1 + .../tests/scenario/runners/replication_runners.py | 12 ++++++++---- trove/tests/scenario/runners/test_runners.py | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/trove/tests/scenario/runners/__init__.py b/trove/tests/scenario/runners/__init__.py index e69de29bb2..7c1af8c54d 100644 --- a/trove/tests/scenario/runners/__init__.py +++ b/trove/tests/scenario/runners/__init__.py @@ -0,0 +1 @@ +BUG_EJECT_VALID_MASTER = 1622014 diff --git a/trove/tests/scenario/runners/replication_runners.py b/trove/tests/scenario/runners/replication_runners.py index 3c3d2a4eeb..99e2143723 100644 --- a/trove/tests/scenario/runners/replication_runners.py +++ b/trove/tests/scenario/runners/replication_runners.py @@ -15,7 +15,9 @@ from trove.common import utils from trove.tests.scenario.helpers.test_helper import DataType +from trove.tests.scenario import runners from trove.tests.scenario.runners.test_runners import CheckInstance +from trove.tests.scenario.runners.test_runners import SkipKnownBug from trove.tests.scenario.runners.test_runners import TestRunner from troveclient.compat import exceptions @@ -230,10 +232,12 @@ class ReplicationRunner(TestRunner): def run_eject_valid_master(self, expected_exception=exceptions.BadRequest, expected_http_code=400): - self.assert_raises( - expected_exception, expected_http_code, - self.auth_client.instances.eject_replica_source, - self.instance_info.id) + # self.assert_raises( + # expected_exception, expected_http_code, + # self.auth_client.instances.eject_replica_source, + # self.instance_info.id) + # Uncomment once BUG_EJECT_VALID_MASTER is fixed + raise SkipKnownBug(runners.BUG_EJECT_VALID_MASTER) def run_delete_valid_master(self, expected_exception=exceptions.Forbidden, expected_http_code=403): diff --git a/trove/tests/scenario/runners/test_runners.py b/trove/tests/scenario/runners/test_runners.py index 32d979ff74..7d890ac2a3 100644 --- a/trove/tests/scenario/runners/test_runners.py +++ b/trove/tests/scenario/runners/test_runners.py @@ -15,6 +15,7 @@ import datetime import os +import proboscis import time as timer from oslo_config.cfg import NoSuchOptError @@ -41,6 +42,19 @@ TEST_HELPER_MODULE_NAME = 'test_helper' TEST_HELPER_BASE_NAME = 'TestHelper' +class SkipKnownBug(proboscis.SkipTest): + """Skip test failures due to known bug(s). + These should get fixed sometime in the future. + """ + + def __init__(self, *bugs): + """ + :param bugs: One or more bug references (e.g. link, bug #). + """ + bug_ref = '; '.join(map(str, bugs)) + super(SkipKnownBug, self).__init__("Known bug: %s" % bug_ref) + + class RunnerFactory(object): _test_runner = None