mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-19 21:56:54 +00:00
reduce load
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user