mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-23 04:39:04 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b7f6b5a484 | |||
| 99fa25a545 | |||
| bae5e669ba |
@@ -1,2 +1,2 @@
|
||||
sha256-darwin=9f767b37ed8b1c82da62ea441462d75487785c8086e56f08fb6f6cd89c6e2e52
|
||||
sha256-linux=fbdaf42b220958d4b1e8880e0f8b5a7992d38e21051bb60596dd4538424757d6
|
||||
sha256-darwin=c0c43689fe500083d8ec2f6654f5bc43e58bede775a5c897e78eaa477fd1f489
|
||||
sha256-linux=3b7cf0cb4746d2d26facfd7a22584f628b86cf1b4689a1b71ae319cfe4fa470e
|
||||
|
||||
@@ -393,11 +393,10 @@ async fn test_kms_multipart_upload_interruption() -> Result<(), Box<dyn std::err
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Test KMS resilience to temporary resource constraints
|
||||
/// Test concurrent KMS encryption requests
|
||||
#[tokio::test]
|
||||
async fn test_kms_resource_constraints() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
async fn test_kms_concurrent_encryption_requests() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
init_logging();
|
||||
info!("🧪 Testing KMS behavior under resource constraints");
|
||||
|
||||
let mut kms_env = LocalKMSTestEnvironment::new().await?;
|
||||
let _default_key_id = kms_env.start_rustfs_for_local_kms().await?;
|
||||
@@ -431,29 +430,27 @@ async fn test_kms_resource_constraints() -> Result<(), Box<dyn std::error::Error
|
||||
}
|
||||
|
||||
// Wait for all uploads to complete
|
||||
let mut successful_uploads = 0;
|
||||
let mut failed_uploads = 0;
|
||||
let mut failures = Vec::new();
|
||||
|
||||
for task in upload_tasks {
|
||||
let (object_key, result) = task.await.unwrap();
|
||||
let (object_key, result) = task.await?;
|
||||
match result {
|
||||
Ok(_) => {
|
||||
successful_uploads += 1;
|
||||
info!("✅ Rapid upload {} succeeded", object_key);
|
||||
}
|
||||
Err(e) => {
|
||||
failed_uploads += 1;
|
||||
warn!("❌ Rapid upload {} failed: {}", object_key, e);
|
||||
failures.push(format!("{object_key}: {e}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info!("📊 Rapid upload results: {} succeeded, {} failed", successful_uploads, failed_uploads);
|
||||
|
||||
// We expect most uploads to succeed even under load
|
||||
assert!(successful_uploads >= 7, "Expected at least 7/10 rapid uploads to succeed");
|
||||
assert!(
|
||||
failures.is_empty(),
|
||||
"all 10 concurrent KMS uploads must succeed; failures: {}",
|
||||
failures.join("; ")
|
||||
);
|
||||
|
||||
kms_env.base_env.delete_test_bucket(TEST_BUCKET).await?;
|
||||
info!("✅ Resource constraints test completed successfully");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user