diff --git a/packages/legacy-sensor/test/api/test.js b/packages/legacy-sensor/test/api/test.js index fa97192d38..3ce0d9355c 100644 --- a/packages/legacy-sensor/test/api/test.js +++ b/packages/legacy-sensor/test/api/test.js @@ -10,15 +10,17 @@ const expect = require('chai').expect; const config = require('../../../core/test/config'); const testUtils = require('../../../core/test/test_util'); const ProcessControls = require('../../../collector/test/test_util/ProcessControls'); +const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls; describe('legacy sensor/API', function () { this.timeout(config.getTestTimeout()); - const agentControls = require('../../../collector/test/apps/agentStubControls'); + const agentControls = new AgentStubControls(5210); agentControls.registerTestHooks(); const controls = new ProcessControls({ dirname: __dirname, + port: 5215, agentControls }).registerTestHooks(); diff --git a/packages/legacy-sensor/test/metrics/test.js b/packages/legacy-sensor/test/metrics/test.js index 1b6057009e..6bc9858e71 100644 --- a/packages/legacy-sensor/test/metrics/test.js +++ b/packages/legacy-sensor/test/metrics/test.js @@ -11,15 +11,17 @@ const _ = require('lodash'); const config = require('../../../core/test/config'); const testUtils = require('../../../core/test/test_util'); const ProcessControls = require('../../../collector/test/test_util/ProcessControls'); +const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls; describe('legacy sensor/metrics', function () { this.timeout(config.getTestTimeout()); - const agentControls = require('../../../collector/test/apps/agentStubControls'); + const agentControls = new AgentStubControls(5210); agentControls.registerTestHooks(); const controls = new ProcessControls({ dirname: __dirname, + port: 5215, agentControls }).registerTestHooks(); diff --git a/packages/legacy-sensor/test/tracing/test.js b/packages/legacy-sensor/test/tracing/test.js index bcb5d7c54e..c69cd49680 100644 --- a/packages/legacy-sensor/test/tracing/test.js +++ b/packages/legacy-sensor/test/tracing/test.js @@ -14,8 +14,10 @@ const ProcessControls = require('../../../collector/test/test_util/ProcessContro const config = require('../../../core/test/config'); const testUtils = require('../../../core/test/test_util'); +const AgentStubControls = require('../../../collector/test/apps/agentStubControls').AgentStubControls; -const serverPort = 3216; +const clientPort = 5215; +const serverPort = 5216; let agentControls; @@ -24,7 +26,7 @@ describe('legacy sensor/tracing', function () { return; } - agentControls = require('../../../collector/test/apps/agentStubControls'); + agentControls = new AgentStubControls(5210); this.timeout(config.getTestTimeout() * 2); @@ -38,6 +40,7 @@ describe('legacy sensor/tracing', function () { const clientControls = new ProcessControls({ appPath: path.join(__dirname, 'clientApp'), + port: clientPort, agentControls, env: { SERVER_PORT: serverPort diff --git a/test-suite-ports.md b/test-suite-ports.md new file mode 100644 index 0000000000..cfe8ece786 --- /dev/null +++ b/test-suite-ports.md @@ -0,0 +1,19 @@ +Port Ranges for Test Suites +=========================== + +The integration test suites for individual packages (collector, aws-fargate, aws-lambde, google-cloud-run, ...) run concurrently on CI, so we need to make sure there are no port conflicts between those. + +For this reason, we maintain an overview of the ports used by the integration test suites of all packages. To avoid port conflicts, this needs to include the ports for applications under test as well as auxilliary applications like agent mocks, back end mocks, proxies etc. and infrastructure componentes running in containers (databases, message brokers, ...). + +| Package | Port Range | +| -------------------- | ---------- | +| aws-fargate | app under test: 4215, mock back end: 9443, downstream dummy: 4567, metadata endpoint mock: 1604, proxy 4128 | +| aws-lambda | mock back end: 8443, mock Lambda extension: 7365, downstream dummy: 3456, proxy: 3128 | +| collector | apps under test: 3000, 3213-3217, 3222, 4200-4203; mock agent: 3210,3211, PostgreSQL: 5432, MongoDB: 27017, MSSQL: 1433, Elasticsearch: 9200, Redis: 6379, NATS: 4222, 4223, Kafka: 9092, RabbitMQ: 5672, GRPC: 50051 | +| core | N.A. (no integration tests, only unit tests) | +| google-cloud-run | app under test: 4216, mock back end: 9444, downstream dummy: 4568, metadata endpoint mock: 1605, proxy: N.A. (no proxy tests) | +| legacy-sensor | apps under test: 5215, 5216; mock agent: 5210 | +| metrics-util | N.A. (no integration tests, only unit tests) | +| serverless | N.A. (no integration tests, only unit tests) | +| shared-metrics | N.A. (no integration tests, only unit tests) | +