Skip to content

Fix Flaky Test in Clickhouse CI#26080

Merged
imjalpreet merged 1 commit intoprestodb:masterfrom
nishithakbhaskaran:clickhouse-flaky-test
Sep 18, 2025
Merged

Fix Flaky Test in Clickhouse CI#26080
imjalpreet merged 1 commit intoprestodb:masterfrom
nishithakbhaskaran:clickhouse-flaky-test

Conversation

@nishithakbhaskaran
Copy link
Contributor

@nishithakbhaskaran nishithakbhaskaran commented Sep 18, 2025

Description

Fix flaky test in Clickhouse CI

Motivation and Context

Resolves #26079

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Sep 18, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 18, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjust the ClickHouse test setup to bind to an ephemeral HTTP port instead of a fixed port to prevent CI test flakes due to port conflicts.

File-Level Changes

Change Details Files
Use ephemeral HTTP port in TestingClickHouseServer
  • Changed hard-coded port "8080" to "0" in server configuration map
presto-clickhouse/src/test/java/com/facebook/presto/plugin/clickhouse/TestClickHouseDistributedQueries.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@nishithakbhaskaran nishithakbhaskaran marked this pull request as ready for review September 18, 2025 14:04
@nishithakbhaskaran nishithakbhaskaran requested a review from a team as a code owner September 18, 2025 14:04
@prestodb-ci prestodb-ci requested review from a team, jkhaliqi and libianoss and removed request for a team September 18, 2025 14:04
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Add a brief comment explaining that port "0" is used to request an ephemeral port and avoid conflicts in CI.
  • Verify that the ClickHouse query runner properly reads and propagates the dynamically assigned port rather than assuming a fixed value.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Add a brief comment explaining that port "0" is used to request an ephemeral port and avoid conflicts in CI.
- Verify that the ClickHouse query runner properly reads and propagates the dynamically assigned port rather than assuming a fixed value.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nishithakbhaskaran nishithakbhaskaran changed the title Fix flakytest in Clickhouse CI Fix Flaky Test in Clickhouse CI Sep 18, 2025
Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

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

Thank you, @nishithakbhaskaran. I just faced the issue and saw you already fixed it.

this.clickhouseServer = new TestingClickHouseServer();
return createClickHouseQueryRunner(clickhouseServer,
ImmutableMap.of("http-server.http.port", "8080"),
ImmutableMap.of("http-server.http.port", "0"),
Copy link
Member

Choose a reason for hiding this comment

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

I think this is handled in TestingPrestoServer as well. If we just don't add this property, it will default to 0. Can we try that too?

String coordinatorPort = properties.remove("http-server.http.port");
if (coordinatorPort == null) {
coordinatorPort = "0";
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, let me try out.

tdcmeehan
tdcmeehan previously approved these changes Sep 18, 2025
Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

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

Thanks, @nishithakbhaskaran. Just a small suggestion.

@@ -61,7 +61,7 @@ protected QueryRunner createQueryRunner()
{
this.clickhouseServer = new TestingClickHouseServer();
return createClickHouseQueryRunner(clickhouseServer,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.PTAL

@imjalpreet imjalpreet merged commit e960542 into prestodb:master Sep 18, 2025
76 of 78 checks passed
@nishithakbhaskaran nishithakbhaskaran deleted the clickhouse-flaky-test branch September 19, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Test : Clickhouse CI - TestClickHouseDistributedQueries

4 participants