test(node): Streamline amqplib tests#21723
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 06ae91d. Configure here.
Combine this into a single test to ensure this does not run out of sync. Now, we simply use different docker files, leverage additionalDependencies, and otherwise use the same tests.
| expect(consumer!.contexts?.trace).toMatchObject(EXPECTED_MESSAGE_SPAN_CONSUMER); | ||
| }, | ||
| }) | ||
| .start() | ||
| .completed(); | ||
| }); | ||
| }, | ||
| { additionalDependencies }, | ||
| ); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Bug: The amqplib v1 and v2 test suites run in parallel but use the same hardcoded port 5672 in their shared docker-compose.yml, causing a port conflict.
Severity: HIGH
Suggested Fix
To prevent port conflicts, ensure each parallel test suite uses a unique port. This can be achieved by either running the v1 and v2 test suites sequentially or by dynamically assigning different ports to the RabbitMQ containers for each test suite. Modifying the test setup to avoid shared, hardcoded resources during parallel execution is necessary.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts#L68-L78
Potential issue: The test configuration uses Vitest's thread pool (`pool: 'threads'`)
without limiting the number of threads, enabling parallel execution. Both the v1 and v2
`amqplib` test suites, now wrapped in `describe.each`, use the same `docker-compose.yml`
file which hardcodes RabbitMQ to port `5672`. When these tests run concurrently on a
multi-core machine, they will attempt to start a Docker container on the same port,
resulting in a "port is already allocated" error and causing the test suite to fail.
Also affects:
dev-packages/node-integration-tests/suites/tracing/amqplib/docker-compose.yml:5~6
There was a problem hiding this comment.
this runs sequentially so should hopefully be OK

Combine this into a single test to ensure this does not run out of sync. Now, we simply use different docker files, leverage additionalDependencies, and otherwise use the same tests.
Closes #21692
Closes #21693
(possibly, but let's see..)