Browse Source

pre-allocate volumes

pull/7160/head
chrislu 1 month ago
parent
commit
1c64ec6476
  1. 3
      test/s3/iam/Makefile
  2. 12
      test/s3/iam/s3_iam_distributed_test.go

3
test/s3/iam/Makefile

@ -70,6 +70,7 @@ start-services: ## Start SeaweedFS services for testing
@$(WEED_BINARY) volume -port=$(VOLUME_PORT) \
-dataCenter=dc1 -rack=rack1 \
-dir=test-volume-data \
-max=100 \
-mserver=localhost:$(MASTER_PORT) > weed-volume.log 2>&1 & \
echo $$! > $(VOLUME_PID_FILE)
@ -103,6 +104,8 @@ wait-for-services: ## Wait for all services to be ready
@echo "Checking S3 API server..."
@timeout 30 bash -c 'until curl -s http://localhost:$(S3_PORT) > /dev/null 2>&1; do sleep 1; done' || (echo "❌ S3 API failed to start" && exit 1)
@echo "Pre-allocating volumes for concurrent operations..."
@curl -s "http://localhost:$(MASTER_PORT)/vol/grow?collection=default&count=10&replication=000" > /dev/null || echo "⚠️ Volume pre-allocation failed, but continuing..."
@sleep 3
@echo "✅ All services are ready"

12
test/s3/iam/s3_iam_distributed_test.go

@ -105,10 +105,10 @@ func TestS3IAMDistributedTests(t *testing.T) {
t.Run("distributed_concurrent_operations", func(t *testing.T) {
// Test concurrent operations across distributed instances with robust retry mechanisms
// This approach implements proper retry logic instead of tolerating errors to catch real concurrency issues
const numGoroutines = 4 // Optimal concurrency for CI reliability
const numOperationsPerGoroutine = 2 // Minimal operations per goroutine
const maxRetries = 3 // Maximum retry attempts for transient failures
const retryDelay = 100 * time.Millisecond
const numGoroutines = 3 // Reduced concurrency for better CI reliability
const numOperationsPerGoroutine = 2 // Minimal operations per goroutine
const maxRetries = 3 // Maximum retry attempts for transient failures
const retryDelay = 200 * time.Millisecond // Increased delay for better stability
var wg sync.WaitGroup
errors := make(chan error, numGoroutines*numOperationsPerGoroutine)
@ -224,8 +224,8 @@ func TestS3IAMDistributedTests(t *testing.T) {
t.Logf("Warning: Failed to cleanup bucket %s: %v", bucketName, err)
}
// Small delay between operation sequences to reduce server load
time.Sleep(50 * time.Millisecond)
// Increased delay between operation sequences to reduce server load and improve stability
time.Sleep(100 * time.Millisecond)
}
}(i)
}

Loading…
Cancel
Save