diff --git a/testbed/testbed/otelcol_runner_test.go b/testbed/testbed/otelcol_runner_test.go index 46ae8510ddd..f855f70672b 100644 --- a/testbed/testbed/otelcol_runner_test.go +++ b/testbed/testbed/otelcol_runner_test.go @@ -27,7 +27,7 @@ func TestNewInProcessPipeline(t *testing.T) { factories, err := defaultcomponents.Components() assert.NoError(t, err) sender := NewOTLPTraceDataSender(DefaultHost, GetAvailablePort(t)) - receiver := NewOTLPDataReceiver(DefaultOTLPPort) + receiver := NewOTLPDataReceiver(GetAvailablePort(t)) runner := NewInProcessCollector(factories, sender.Port) format := ` diff --git a/testbed/testbed/receivers.go b/testbed/testbed/receivers.go index 5bfddf78745..fe09bf9436f 100644 --- a/testbed/testbed/receivers.go +++ b/testbed/testbed/receivers.go @@ -84,8 +84,6 @@ type OCDataReceiver struct { // Ensure OCDataReceiver implements DataReceiver. var _ DataReceiver = (*OCDataReceiver)(nil) -const DefaultOCPort = 56565 - // NewOCDataReceiver creates a new OCDataReceiver that will listen on the specified port after Start // is called. func NewOCDataReceiver(port int) *OCDataReceiver { @@ -138,8 +136,6 @@ type JaegerDataReceiver struct { receiver component.TraceReceiver } -const DefaultJaegerPort = 14250 - func NewJaegerDataReceiver(port int) *JaegerDataReceiver { return &JaegerDataReceiver{DataReceiverBase: DataReceiverBase{Port: port}} } @@ -187,8 +183,6 @@ type OTLPDataReceiver struct { // Ensure OTLPDataReceiver implements DataReceiver. var _ DataReceiver = (*OTLPDataReceiver)(nil) -const DefaultOTLPPort = 55680 - // NewOTLPDataReceiver creates a new OTLPDataReceiver that will listen on the specified port after Start // is called. func NewOTLPDataReceiver(port int) *OTLPDataReceiver { @@ -243,8 +237,6 @@ type ZipkinDataReceiver struct { receiver component.TraceReceiver } -const DefaultZipkinAddressPort = 9411 - func NewZipkinDataReceiver(port int) *ZipkinDataReceiver { return &ZipkinDataReceiver{DataReceiverBase: DataReceiverBase{Port: port}} } diff --git a/testbed/tests/e2e_test.go b/testbed/tests/e2e_test.go index 885f6b9441d..77829879497 100644 --- a/testbed/tests/e2e_test.go +++ b/testbed/tests/e2e_test.go @@ -34,8 +34,8 @@ func TestIdleMode(t *testing.T) { tc := testbed.NewTestCase( t, dataProvider, - testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.DefaultJaegerPort), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), &testbed.ChildProcess{}, &testbed.PerfTestValidator{}, performanceResultsSummary, @@ -64,8 +64,8 @@ func TestBallastMemory(t *testing.T) { tc := testbed.NewTestCase( t, dataProvider, - testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.DefaultJaegerPort), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), &testbed.ChildProcess{}, &testbed.PerfTestValidator{}, performanceResultsSummary, diff --git a/testbed/tests/metric_test.go b/testbed/tests/metric_test.go index 8331b2e563a..44e1c6fc14c 100644 --- a/testbed/tests/metric_test.go +++ b/testbed/tests/metric_test.go @@ -29,8 +29,8 @@ func TestMetricNoBackend10kDPSOpenCensus(t *testing.T) { tc := testbed.NewTestCase( t, dataProvider, - testbed.NewOCMetricDataSender(testbed.DefaultHost, 55678), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewOCMetricDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), &testbed.ChildProcess{}, &testbed.PerfTestValidator{}, performanceResultsSummary, diff --git a/testbed/tests/scenarios.go b/testbed/tests/scenarios.go index b50caf651ff..31d6c62dd39 100644 --- a/testbed/tests/scenarios.go +++ b/testbed/tests/scenarios.go @@ -194,8 +194,8 @@ func Scenario1kSPSWithAttrs(t *testing.T, args []string, tests []TestCase, opts tc := testbed.NewTestCase( t, testbed.NewPerfTestDataProvider(options), - testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.DefaultJaegerPort), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), &testbed.ChildProcess{}, &testbed.PerfTestValidator{}, test.resultsSummary, diff --git a/testbed/tests/trace_test.go b/testbed/tests/trace_test.go index ce96573e906..c070ecd2c06 100644 --- a/testbed/tests/trace_test.go +++ b/testbed/tests/trace_test.go @@ -149,8 +149,8 @@ func TestTraceNoBackend10kSPS(t *testing.T) { }{ { "JaegerGRPC", - testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.DefaultJaegerPort), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewJaegerGRPCDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), testbed.ResourceSpec{ ExpectedMaxCPU: 70, ExpectedMaxRAM: 198, @@ -159,8 +159,8 @@ func TestTraceNoBackend10kSPS(t *testing.T) { }, { "Zipkin", - testbed.NewZipkinDataSender(testbed.DefaultHost, testbed.DefaultZipkinAddressPort), - testbed.NewOCDataReceiver(testbed.DefaultOCPort), + testbed.NewZipkinDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)), + testbed.NewOCDataReceiver(testbed.GetAvailablePort(t)), testbed.ResourceSpec{ ExpectedMaxCPU: 120, ExpectedMaxRAM: 198,