Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ services:
POSTGRES_DB: test_db
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U test -d test_db']
interval: 2s
interval: 500ms
timeout: 3s
retries: 30
start_period: 5s
retries: 60
start_period: 2s

ready-gate:
image: busybox
depends_on:
db:
condition: service_healthy
command: ['echo', 'postgresjs-ready']
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ready-gate service missing required Docker healthcheck

High Severity

The new ready-gate service does not define a healthcheck:. The node-integration-tests runner uses docker compose up -d --wait, which relies on healthchecks to know when services are ready. Since ready-gate runs echo and exits immediately, it will be in an "exited" state when --wait checks it, potentially causing the command to fail and throwing an error in the runner.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 9bbdd3c. Configure here.

Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ describe('postgresjs auto instrumentation', () => {
};

await createRunner(__dirname, 'scenario.js')
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
Comment on lines +221 to +224
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The readyMatches parameter is passed to a test runner that does not support it. The parameter is silently ignored, making the code misleading and ineffective.
Severity: LOW

Suggested Fix

Remove the readyMatches: ['postgresjs-ready'] parameter from the startDocker call in the test file. The container readiness is already correctly handled by the docker-compose.yml healthcheck and the --wait flag used by the runner.

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/postgresjs/test.ts#L221-L224

Potential issue: The test configuration passes a `readyMatches` parameter to the
`node-integration-tests` runner. However, the runner's `DockerOptions` interface does
not define or use this property, causing the parameter to be silently ignored at
runtime. This makes the code misleading as it appears to configure a readiness check
that is not actually performed. The test's stability relies solely on the `docker
compose up --wait` command and the service's healthcheck, not this parameter.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

readyMatches not supported by this test runner

High Severity

The readyMatches option is passed to withDockerCompose but the DockerOptions interface in the node-integration-tests runner (dev-packages/node-integration-tests/utils/runner.ts) does not include a readyMatches property — it only supports workingDirectory and setupCommand. This feature only exists in the node-core-integration-tests runner. The runner uses docker compose up -d --wait and never reads container logs for match strings, so the entire ready-gate + readyMatches pattern has no effect here and the PR's stated fix (waiting for postgresjs-ready) is not actually achieved.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9bbdd3c. Configure here.

.expect({ transaction: EXPECTED_TRANSACTION })
.expect({ event: EXPECTED_ERROR_EVENT })
.start()
Expand Down Expand Up @@ -438,7 +441,10 @@ describe('postgresjs auto instrumentation', () => {

await createRunner(__dirname, 'scenario.mjs')
.withFlags('--import', `${__dirname}/instrument.mjs`)
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.expect({ event: EXPECTED_ERROR_EVENT })
.start()
Expand Down Expand Up @@ -532,7 +538,10 @@ describe('postgresjs auto instrumentation', () => {

await createRunner(__dirname, 'scenario-requestHook.js')
.withFlags('--require', `${__dirname}/instrument-requestHook.cjs`)
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down Expand Up @@ -625,7 +634,10 @@ describe('postgresjs auto instrumentation', () => {

await createRunner(__dirname, 'scenario-requestHook.mjs')
.withFlags('--import', `${__dirname}/instrument-requestHook.mjs`)
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down Expand Up @@ -706,7 +718,10 @@ describe('postgresjs auto instrumentation', () => {
};

await createRunner(__dirname, 'scenario-url.cjs')
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down Expand Up @@ -787,7 +802,10 @@ describe('postgresjs auto instrumentation', () => {

await createRunner(__dirname, 'scenario-url.mjs')
.withFlags('--import', `${__dirname}/instrument.mjs`)
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down Expand Up @@ -866,7 +884,10 @@ describe('postgresjs auto instrumentation', () => {
};

await createRunner(__dirname, 'scenario-unsafe.cjs')
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down Expand Up @@ -946,7 +967,10 @@ describe('postgresjs auto instrumentation', () => {

await createRunner(__dirname, 'scenario-unsafe.mjs')
.withFlags('--import', `${__dirname}/instrument.mjs`)
.withDockerCompose({ workingDirectory: [__dirname] })
.withDockerCompose({
workingDirectory: [__dirname],
readyMatches: ['postgresjs-ready'],
})
.expect({ transaction: EXPECTED_TRANSACTION })
.start()
.completed();
Expand Down
Loading