From ce35234b1276878e4dd3faf50f2a96bad3edc607 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 22 Oct 2024 18:43:48 -0400 Subject: [PATCH] cleanup Signed-off-by: Yuri Shkuro --- .../internal/integration/e2e_integration.go | 15 ++++++++------- cmd/jaeger/internal/integration/kafka_test.go | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/jaeger/internal/integration/e2e_integration.go b/cmd/jaeger/internal/integration/e2e_integration.go index 462502f75af..ec73205ea17 100644 --- a/cmd/jaeger/internal/integration/e2e_integration.go +++ b/cmd/jaeger/internal/integration/e2e_integration.go @@ -41,10 +41,10 @@ const otlpPort = 4317 type E2EStorageIntegration struct { integration.StorageIntegration - SkipStorageCleaner bool - ConfigFile string - BinaryName string - HealthCheckEndpoint string + SkipStorageCleaner bool + ConfigFile string + BinaryName string + HealthCheckPort int // overridable for Kafka tests which has two binaries and needs different ports // EnvVarOverrides contains a map of environment variables to set. // The key in the map is the environment variable to override and the value @@ -159,10 +159,11 @@ func (s *E2EStorageIntegration) e2eInitialize(t *testing.T, storage string) { } func (s *E2EStorageIntegration) doHealthCheck(t *testing.T) bool { - healthCheckEndpoint := s.HealthCheckEndpoint - if healthCheckEndpoint == "" { - healthCheckEndpoint = "http://localhost:13133/status" + healthCheckPort := s.HealthCheckPort + if healthCheckPort == 0 { + healthCheckPort = ports.CollectorV2HealthChecks } + healthCheckEndpoint := fmt.Sprintf("http://localhost:%d/status", healthCheckPort) t.Logf("Checking if %s is available on %s", s.BinaryName, healthCheckEndpoint) ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() diff --git a/cmd/jaeger/internal/integration/kafka_test.go b/cmd/jaeger/internal/integration/kafka_test.go index 1b942479227..719d46d6df1 100644 --- a/cmd/jaeger/internal/integration/kafka_test.go +++ b/cmd/jaeger/internal/integration/kafka_test.go @@ -52,9 +52,9 @@ func TestKafkaStorage(t *testing.T) { t.Log("Collector initialized") ingester := &E2EStorageIntegration{ - BinaryName: "jaeger-v2-ingester", - ConfigFile: "../../config-kafka-ingester.yaml", - HealthCheckEndpoint: "http://localhost:14133/status", + BinaryName: "jaeger-v2-ingester", + ConfigFile: "../../config-kafka-ingester.yaml", + HealthCheckPort: 14133, StorageIntegration: integration.StorageIntegration{ CleanUp: purge, GetDependenciesReturnsSource: true,