Skip to content

CAMEL-23431: Migrate thrift tests from AvailablePortFinder to port-0 binding#23019

Open
gnodet wants to merge 1 commit intoapache:mainfrom
gnodet:CAMEL-23431-port0-thrift
Open

CAMEL-23431: Migrate thrift tests from AvailablePortFinder to port-0 binding#23019
gnodet wants to merge 1 commit intoapache:mainfrom
gnodet:CAMEL-23431-port0-thrift

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 6, 2026

CAMEL-23431

Summary

Third PR for CAMEL-23431. Migrates all camel-thrift tests (10 test files) from AvailablePortFinder to port-0 binding, completely eliminating AvailablePortFinder from the thrift module.

Production code:

  • Add getLocalPort() to ThriftConsumer to expose the OS-assigned port after server start

Producer tests (create own server):

  • ThriftProducerBaseTest: Move server creation to doPreSetup(), bind TNonblockingServerSocket to port 0
  • ThriftProducerSecurityTest: Same pattern with TSSLTransportFactory
  • ThriftProducerZlibCompressionTest: Same pattern with TServerSocket
  • ThriftThreadPoolServerTest: Bind to port 0 in @BeforeEach

Consumer tests (Camel component creates server):

  • All 5 consumer tests use port 0 in from() URI, then read back actual port from ThriftConsumer.getLocalPort() for client connections
  • ThriftConsumerConcurrentTest: 2 ports (sync + async) both use port 0

Test plan

  • mvn test in camel-thrift — 39 tests pass
  • CI green

…binding

Add getLocalPort() to ThriftConsumer to expose the OS-assigned port.
Producer tests (ThriftProducerBaseTest, ThriftProducerSecurityTest,
ThriftProducerZlibCompressionTest, ThriftThreadPoolServerTest) now
create servers with port 0 in doPreSetup() and read back the actual
port. Consumer tests use port 0 in from() URI and read back the port
from ThriftConsumer after context start.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet marked this pull request as ready for review May 6, 2026 16:37
@gnodet gnodet requested review from davsclaus and oscerd May 6, 2026 16:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🧪 CI tested the following changed modules:

  • components/camel-thrift
All tested modules (8 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: Thrift
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants