Skip to content

feat: add Presto module - #3778

Merged
mdelapenya merged 2 commits into
testcontainers:mainfrom
mdelapenya:feat/module-presto
Jul 16, 2026
Merged

mdelapenya merged 2 commits into
testcontainers:mainfrom
mdelapenya:feat/module-presto

Conversation

@mdelapenya

Copy link
Copy Markdown
Member

🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer

Adds the presto testcontainers-go module.

Part of the broader effort to add missing modules — split from #3762.

Part of the broader effort to add missing modules — split from testcontainers#3762.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@mdelapenya, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 576ea305-b49a-42aa-a235-7445689eb1a8

📥 Commits

Reviewing files that changed from the base of the PR and between c92ea61 and 461b470.

⛔ Files ignored due to path filters (1)
  • modules/presto/go.sum is excluded by !**/*.sum
📒 Files selected for processing (9)
  • .github/dependabot.yml
  • .vscode/.testcontainers-go.code-workspace
  • docs/modules/presto.md
  • mkdocs.yml
  • modules/presto/Makefile
  • modules/presto/examples_test.go
  • modules/presto/go.mod
  • modules/presto/presto.go
  • modules/presto/presto_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 461b470
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-go/deploys/6a58a8a26953b000090ed7e6
😎 Deploy Preview https://deploy-preview-3778--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mdelapenya
mdelapenya marked this pull request as ready for review July 16, 2026 09:36
@mdelapenya
mdelapenya requested a review from a team as a code owner July 16, 2026 09:36

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ba55d3ca1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/presto/presto.go Outdated
Comment on lines +56 to +57
starting, _ := info["starting"].(bool)
return !starting

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wait until Presto can execute queries

When a test opens a Presto client and sends a query immediately after Run, this readiness check can still return too early: /v1/info with starting=false only proves the server/catalog loading phase is done, not that the single worker has registered and can accept scheduled work. With the stock prestodb/presto container this startup race is known to produce No nodes available to run query for the first query (see prestodb/presto#23226), and the new test only checks the URL prefix so it would not catch it. Please make the wait strategy prove query readiness, e.g. by polling a lightweight statement or active-worker state before returning.

Useful? React with 👍 / 👎.

Comment thread modules/presto/presto.go Outdated
return "", fmt.Errorf("get mapped port: %w", err)
}

return fmt.Sprintf("http://%s:%s", host, port.Port()), nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Build the HTTP endpoint with PortEndpoint

When the Docker host is configured as an IPv6 literal, for example via TESTCONTAINERS_HOST_OVERRIDE=::1, this formatting returns an invalid URL like http://::1:12345; callers cannot parse or dial it. The core DockerContainer.PortEndpoint helper already uses net.JoinHostPort to produce http://[::1]:12345, so this module should use that helper (or equivalent bracketing) for the HTTP connection string.

Useful? React with 👍 / 👎.

- P2 #1: Replace single /v1/info wait with wait.ForAll combining
  /v1/info (starting=false) and /v1/cluster (activeWorkers>0).
  This eliminates the known 'No nodes available' startup race.
- P2 #2: Use c.PortEndpoint(ctx, httpPort, "http") in ConnectionString
  instead of manual fmt.Sprintf, fixing IPv6-host formatting.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mdelapenya

Copy link
Copy Markdown
Member Author

🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer

Addressed both P2 findings in commit 461b470 on feat/module-presto:

P2 #1 (line 57 — worker readiness): Wait strategy now uses wait.ForAll chaining two HTTP checks: /v1/info (starting=false) and /v1/cluster (activeWorkers>0). The second check ensures at least one worker has registered before Run returns, eliminating the 'No nodes available to run query' startup race.

P2 #2 (line 38 — IPv6): ConnectionString now delegates to c.PortEndpoint(ctx, httpPort, "http") which correctly brackets IPv6 hosts (e.g. http://[::1]:12345) instead of the broken manual fmt.Sprintf.

@mdelapenya mdelapenya added the enhancement New feature or request label Jul 16, 2026
@mdelapenya
mdelapenya merged commit 611ed22 into testcontainers:main Jul 16, 2026
17 checks passed
@mdelapenya
mdelapenya deleted the feat/module-presto branch July 16, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant