ceph / ceph/s3-tests

Bucket created twice in test_bucket_list_return_data_versioning

Open
#738 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
372
Forks
328
PR merge metrics
No merged PRs in 30d

Description

**Background:**
I was trying to remove s3tests_boto3/functional/test_s3.py::test_bucket_list_return_data_versioning from the blacklisted tests.
While trying to do so, i encountered the following error:

`botocore.errorfactory.BucketAlreadyExists: An error occurred (BucketAlreadyExists) when calling the CreateBucket operation: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.`

**Expected Behavior:**
The test should create a single bucket and populate it with objects, without triggering a bucket name conflict.

**Actual Behavior:**
The test attempts to create the same bucket twice, resulting in a BucketAlreadyExists error due to the global namespace constraint.

**IRoot Cause (Suspected):**
In the S3 test suite, the test_bucket_list_return_data_versioning function in 'test_s3.py' creates a bucket twice: once explicitly via get_new_bucket(), and again implicitly via _create_objects() when populating the bucket with test objects. This occurs because _create_objects() creates a new bucket resource when the bucket parameter is None, even when a bucket_name is provided, leading to redundant bucket creation and potential test instability.

**Steps to reproduce:**
Run the specific test:
`S3TEST_CONF=test_nsfs_ceph_s3_config.conf python3 -m tox -- -s ./s3tests/functional/test_s3.py::test_bucket_list_return_data_versioning`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.