Skip to content

test(s3): cover delete bucket network fallback#166

Open
overtrue wants to merge 1 commit intomainfrom
codex/test-delete-bucket-network-fallback
Open

test(s3): cover delete bucket network fallback#166
overtrue wants to merge 1 commit intomainfrom
codex/test-delete-bucket-network-fallback

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related

This pull request adds focused regression coverage for the recent delete_bucket error mapping work in #163.

Background

delete_bucket() now distinguishes NoSuchBucket and BucketNotEmpty from other backend failures. That behavior was covered for the two special-case branches, but the generic fallback path was still untested.

Root Cause

The recent change introduced a third branch that maps all remaining SDK failures to Error::Network. Without a direct test, later edits could accidentally change that fallback classification or stop surfacing the backend error code.

Solution

Add one narrow unit test beside the existing delete_bucket regression tests in crates/s3/src/client.rs. The new test drives a synthetic InternalError response and asserts that the client keeps classifying it as Error::Network while preserving the backend code in the message.

Validation

I ran the focused seam first with cargo test -p rc-s3 delete_bucket_maps_ --lib, then the full repository gate with make pre-commit.

@overtrue overtrue marked this pull request as ready for review April 30, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant