Skip to content

Fix CI parse_errors.sh and replace deprecated AvailablePortFinder#1745

Merged
cunningt merged 2 commits intoapache:mainfrom
cunningt:moredeprecation2
Apr 13, 2026
Merged

Fix CI parse_errors.sh and replace deprecated AvailablePortFinder#1745
cunningt merged 2 commits intoapache:mainfrom
cunningt:moredeprecation2

Conversation

@cunningt
Copy link
Copy Markdown
Contributor

@cunningt cunningt commented Apr 11, 2026

This commit was started to replace some deprecated API used in tests but kind of morphed because there were a lot of unrelated issues with running the incremental tests in CI. Here are the changes

  • replace AvailablePortFinder.getNextAvailable() (deprecated) usage in a few tests
  • add a parse_errors.sh script - this was missing in camel-spring-boot and incremental tests were failing because it didn't exist
  • change CamelVirtualThreadsTests to an integration test : I tried a lot of avenues to try to get this test to work in CI, but it appears that the thread type gets set by the first test run and we were getting platform threads within the test every time in CI. I've changed it to be an integration test that runs if we're not in CI (there's a profile that checks for the ci.env name) because even after changing this to an IT it was failing due to previous tests run in surefire.

@cunningt cunningt marked this pull request as draft April 11, 2026 15:49
@cunningt cunningt marked this pull request as ready for review April 11, 2026 15:50
@cunningt cunningt marked this pull request as draft April 11, 2026 16:25
@cunningt cunningt force-pushed the moredeprecation2 branch 3 times, most recently from ca1093c to 3daae91 Compare April 11, 2026 20:43
1. **Fix parse_errors.sh script**: Added error handling to prevent CI
   failures when processing surefire test reports. The script now:
   - Uses set +e to handle errors gracefully
   - Checks file existence and readability before processing
   - Only outputs when actual failures are found (reduced log noise)
   - Properly escapes grep patterns and suppresses errors

2. **Replace deprecated AvailablePortFinder.getNextAvailable()**: Updated
   18 test files to use AvailablePortFinder.find().getPort() instead.
   Note: SftpSimpleProduceThroughProxyTest kept using getNextAvailable()
   as the test is already failing on main.

3. **Add CamelVirtualThreadsIT for local verification**: Created an
   integration test to verify virtual threads work correctly. The test
   runs in a forked JVM via maven-failsafe-plugin during `mvn verify`,
   but only when not in CI (using a profile that checks ci.env.name).
   This avoids ThreadType static initialization timing issues in CI.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cunningt cunningt requested a review from Croway April 11, 2026 21:30
@cunningt cunningt marked this pull request as ready for review April 11, 2026 21:30
@cunningt cunningt merged commit 181c63e into apache:main Apr 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants