fix: stabilize s3-tests delete key-limit coverage (#4283)

* fix: tighten list handling and s3 test support

* chore: tidy imports and metric updates

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zhengchao An <anzhengchao@gmail.com>

* fix: address s3tests review follow-ups

---------

Signed-off-by: Zhengchao An <anzhengchao@gmail.com>
Co-authored-by: Zhengchao An <anzhengchao@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2026-07-05 20:35:32 +08:00
committed by GitHub
parent 46bb7e52b6
commit 76124423a4
8 changed files with 356 additions and 50 deletions
+22
View File
@@ -8333,6 +8333,28 @@ mod tests {
assert_eq!(err.code(), &S3ErrorCode::InvalidArgument);
}
#[tokio::test]
async fn execute_delete_objects_rejects_more_than_one_thousand_objects_before_store_lookup() {
let objects = (0..1001)
.map(|idx| ObjectIdentifier {
key: format!("test-key-{idx}"),
version_id: None,
..Default::default()
})
.collect();
let input = DeleteObjectsInput::builder()
.bucket("test-bucket".to_string())
.delete(Delete { objects, quiet: None })
.build()
.expect("delete objects input should build");
let req = build_request(input, Method::POST);
let usecase = DefaultObjectUsecase::without_context();
let err = usecase.execute_delete_objects(req).await.unwrap_err();
assert_eq!(err.code(), &S3ErrorCode::InvalidArgument);
}
#[tokio::test]
async fn execute_delete_objects_returns_internal_error_when_store_uninitialized() {
let input = DeleteObjectsInput::builder()