Skip to content

Bucket created twice in test_bucket_list_return_data_versioning #738

@sakshimunjal

Description

@sakshimunjal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions