diff --git a/gnocchi/tests/base.py b/gnocchi/tests/base.py index e5412981..0388d1ed 100644 --- a/gnocchi/tests/base.py +++ b/gnocchi/tests/base.py @@ -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 diff --git a/gnocchi/tests/test_storage.py b/gnocchi/tests/test_storage.py index eb55e839..6fc8f9e9 100644 --- a/gnocchi/tests/test_storage.py +++ b/gnocchi/tests/test_storage.py @@ -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)