Merge "s3: use a different bucket prefix for each test" into stable/3.1

This commit is contained in:
Jenkins 2017-02-17 22:58:57 +00:00 committed by Gerrit Code Review
commit 54631be2e8
2 changed files with 5 additions and 16 deletions

View File

@ -294,6 +294,11 @@ class TestCase(base.BaseTestCase):
os.getenv("CEPH_CONF"), pool_name), shell=True)
self.conf.set_override('ceph_pool', pool_name, 'storage')
# Override the bucket prefix to be unique to avoid concurrent access
# with any other test
self.conf.set_override("s3_bucket_prefix", str(uuid.uuid4())[:26],
"storage")
self.storage = storage.get_driver(self.conf)
# NOTE(jd) Do not upgrade the storage. We don't really need the storage
# upgrade for now, and the code that upgrade from pre-1.3

View File

@ -55,10 +55,6 @@ class TestStorageDriver(tests_base.TestCase):
def test_corrupted_data(self):
if not isinstance(self.storage, _carbonara.CarbonaraBasedStorage):
self.skipTest("This driver is not based on Carbonara")
if self.conf.storage.driver == "s3":
self.skipTest(
"This test does not work with S3 as backend as the S3 driver "
"has no fake client, and tests run in parallel.")
self.storage.incoming.add_measures(self.metric, [
storage.Measure(utils.dt_to_unix_ns(2014, 1, 1, 12, 0, 1), 69),
@ -81,10 +77,6 @@ class TestStorageDriver(tests_base.TestCase):
self.assertIn((utils.datetime_utc(2014, 1, 1, 13), 300.0, 1), m)
def test_list_metric_with_measures_to_process(self):
if self.conf.storage.driver == "s3":
self.skipTest(
"This test does not work with S3 as backend as the S3 driver "
"has no fake client, and tests run in parallel.")
metrics = self.storage.incoming.list_metric_with_measures_to_process(
None, None, full=True)
self.assertEqual(set(), metrics)
@ -150,10 +142,6 @@ class TestStorageDriver(tests_base.TestCase):
@mock.patch('gnocchi.carbonara.SplitKey.POINTS_PER_SPLIT', 48)
def test_add_measures_update_subset_split(self):
if self.conf.storage.driver == "s3":
self.skipTest(
"This test does not work with S3 as backend as the S3 driver "
"has no fake client, and tests run in parallel.")
m, m_sql = self._create_metric('medium')
measures = [
storage.Measure(utils.dt_to_unix_ns(2014, 1, 6, i, j, 0), 100)
@ -177,10 +165,6 @@ class TestStorageDriver(tests_base.TestCase):
self.assertEqual(1, count)
def test_add_measures_update_subset(self):
if self.conf.storage.driver == "s3":
self.skipTest(
"This test does not work with S3 as backend as the S3 driver "
"has no fake client, and tests run in parallel.")
m, m_sql = self._create_metric('medium')
measures = [
storage.Measure(utils.dt_to_unix_ns(2014, 1, 6, i, j, 0), 100)