mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-19 05:36:58 +00:00
pre-allocate volumes
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user