address comments

This commit is contained in:
chrislu committed 2025-08-26 21:55:31 -07:00
1 parent 2c76a10a21
commit b20257afb1
4 files changed
+135 -27

No files matched your search

+7 -3
View File
@@ -87,7 +87,7 @@ start-services: ## Start SeaweedFS services for testing
@$(WEED_BINARY) -v=3 s3 -port=$(S3_PORT) \
-filer=localhost:$(FILER_PORT) \
-config=test_config.json \
-iam.config=$(shell pwd)/iam_config.json > weed-s3.log 2>&1 & \
-iam.config=$(CURDIR)/iam_config.json > weed-s3.log 2>&1 & \
echo $$! > $(S3_PID_FILE)
@echo "✅ All services started"
@@ -234,9 +234,11 @@ docker-logs: ## Show logs from all services
docker-test: docker-up ## Run tests with Docker Compose including Keycloak
@echo "🧪 Running Keycloak integration tests..."
@echo "⏳ Waiting for services to be ready..."
@timeout 120 bash -c 'until curl -s http://localhost:8080/health/ready > /dev/null 2>&1; do sleep 2; done' || (echo "❌ Keycloak failed to become ready" && exit 1)
@timeout 60 bash -c 'until curl -s http://localhost:8333 > /dev/null 2>&1; do sleep 2; done' || (echo "❌ S3 API failed to become ready" && exit 1)
@export KEYCLOAK_URL="http://localhost:8080" && \
export S3_ENDPOINT="http://localhost:8333" && \
sleep 10 && \
go test -v -timeout $(TEST_TIMEOUT) -run "TestKeycloak" ./...
@echo "🐳 Stopping services after tests..."
@make docker-down
@@ -274,9 +276,11 @@ test-versioning-stress: ## Run S3 versioning stress tests
test-keycloak-full: docker-up ## Run complete Keycloak integration tests
@echo "🔐 Running complete Keycloak integration tests..."
@echo "⏳ Waiting for services to be ready..."
@timeout 120 bash -c 'until curl -s http://localhost:8080/health/ready > /dev/null 2>&1; do sleep 2; done' || (echo "❌ Keycloak failed to become ready" && exit 1)
@timeout 60 bash -c 'until curl -s http://localhost:8333 > /dev/null 2>&1; do sleep 2; done' || (echo "❌ S3 API failed to become ready" && exit 1)
@export KEYCLOAK_URL="http://localhost:8080" && \
export S3_ENDPOINT="http://localhost:8333" && \
sleep 15 && \
go test -v -timeout $(TEST_TIMEOUT) -run "TestKeycloak" ./...
@make docker-down
+4 -6
View File
@@ -218,13 +218,11 @@ func TestS3IAMDistributedTests(t *testing.T) {
// STRICT CONCURRENCY TESTING: Use appropriate thresholds for the operation count
// For totalOperations=6, error thresholds need to be adjusted to avoid unreachable conditions
// Serious errors (race conditions, deadlocks) should be zero or very rare
maxSeriousErrors := 1 // Allow 1 serious error max (16.7%) for small test size
// Serious errors (race conditions, deadlocks) should be zero for reliable testing
maxSeriousErrors := 0 // Allow 0 serious errors max - any serious error indicates system issues
if len(seriousErrors) > maxSeriousErrors {
t.Errorf("❌ Too many serious errors: %d (%.1f%%) - max allowed: %d. This indicates potential race conditions, deadlocks, or other concurrency bugs.",
len(seriousErrors), seriousErrorRate*100, maxSeriousErrors)
} else if len(seriousErrors) > 0 {
t.Logf("⚠️ %d serious error detected (%.1f%%) - within threshold but should be investigated", len(seriousErrors), seriousErrorRate*100)
t.Errorf("❌ %d serious error(s) detected, indicating potential concurrency bugs. First error: %v",
len(seriousErrors), seriousErrors[0])
}
// For total errors, allow more flexibility with small operation counts