reduce load

This commit is contained in:
chrislu
2025-08-25 11:21:45 -07:00
parent 868b2de213
commit 8c59efad5e
+18 -2
View File
@@ -103,8 +103,9 @@ func TestS3IAMDistributedTests(t *testing.T) {
t.Run("distributed_concurrent_operations", func(t *testing.T) {
// Test concurrent operations across distributed instances
const numGoroutines = 10
const numOperationsPerGoroutine = 5
// Reduced concurrency (3x2=6 total ops) for CI stability
const numGoroutines = 3
const numOperationsPerGoroutine = 2
var wg sync.WaitGroup
errors := make(chan error, numGoroutines*numOperationsPerGoroutine)
@@ -127,6 +128,9 @@ func TestS3IAMDistributedTests(t *testing.T) {
if err := framework.CreateBucket(client, bucketName); err != nil {
errors <- err
continue
// Small delay to reduce server load
time.Sleep(100 * time.Millisecond)
}
// Put object
@@ -134,18 +138,27 @@ func TestS3IAMDistributedTests(t *testing.T) {
if err := framework.PutTestObject(client, bucketName, objectKey, fmt.Sprintf("content-%d-%d", goroutineID, j)); err != nil {
errors <- err
continue
// Small delay to reduce server load
time.Sleep(100 * time.Millisecond)
}
// Get object
if _, err := framework.GetTestObject(client, bucketName, objectKey); err != nil {
errors <- err
continue
// Small delay to reduce server load
time.Sleep(100 * time.Millisecond)
}
// Delete object
if err := framework.DeleteTestObject(client, bucketName, objectKey); err != nil {
errors <- err
continue
// Small delay to reduce server load
time.Sleep(100 * time.Millisecond)
}
// Delete bucket
@@ -154,6 +167,9 @@ func TestS3IAMDistributedTests(t *testing.T) {
}); err != nil {
errors <- err
continue
// Small delay to reduce server load
time.Sleep(100 * time.Millisecond)
}
}
}(i)