Skip to content

test(node): Streamline amqplib tests#21723

Merged
mydea merged 2 commits into
developfrom
fn/amqplib-tests
Jun 24, 2026
Merged

test(node): Streamline amqplib tests#21723
mydea merged 2 commits into
developfrom
fn/amqplib-tests

Conversation

@mydea

@mydea mydea commented Jun 24, 2026

Copy link
Copy Markdown
Member

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..)

@mydea mydea self-assigned this Jun 24, 2026
@mydea mydea requested a review from a team as a code owner June 24, 2026 08:16
@mydea mydea requested review from JPeer264 and andreiborza and removed request for a team June 24, 2026 08:16
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
@mydea mydea force-pushed the fn/amqplib-tests branch from 43c4ce7 to 06ae91d Compare June 24, 2026 08:22

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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.

Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/scenario.mjs Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/scenario.mjs Outdated
Comment thread dev-packages/node-integration-tests/suites/tracing/amqplib/test.ts Outdated
@mydea mydea force-pushed the fn/amqplib-tests branch from 06ae91d to 8ece908 Compare June 24, 2026 08:38
mydea added 2 commits June 24, 2026 10:52
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.
@mydea mydea force-pushed the fn/amqplib-tests branch from 8ece908 to f567775 Compare June 24, 2026 08:52
Comment on lines +68 to 78
expect(consumer!.contexts?.trace).toMatchObject(EXPECTED_MESSAGE_SPAN_CONSUMER);
},
})
.start()
.completed();
});
},
{ additionalDependencies },
);
});
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this runs sequentially so should hopefully be OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants