[Fix][UT]Fix AbfsFileSystemBehaviorITCase fails with "Bind Address already in use" in CI #2630
Open
litiliu wants to merge 2 commits intoapache:mainfrom
Open
[Fix][UT]Fix AbfsFileSystemBehaviorITCase fails with "Bind Address already in use" in CI #2630litiliu wants to merge 2 commits intoapache:mainfrom
litiliu wants to merge 2 commits intoapache:mainfrom
Conversation
Author
|
@luoyuxia please approve the workflows. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes flaky Azure filesystem integration tests in CI by removing a hard-coded mock auth server port and switching to an ephemeral port that is propagated into test configuration (linked to #2629).
Changes:
- Bind
MockAuthServerto an ephemeral port (bind(0)) and expose the selected port viagetPort(). - Update Azure filesystem IT/UT to build the OAuth endpoint from
localhost:<selectedPort>.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java |
Bind to port 0, capture the chosen local port, and expose it to callers. |
fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenProviderTest.java |
Use the mock server’s dynamically assigned port for the token endpoint. |
fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java |
Configure the ABFS OAuth endpoint using the dynamically assigned port. |
Comments suppressed due to low confidence (1)
fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java:76
run()catchesInterruptedExceptionand immediately wraps it in aRuntimeExceptionwithout restoring the thread interrupt flag. This can cause higher-level test/framework code to miss the interrupt signal. Consider callingThread.currentThread().interrupt()before rethrowing (or usesyncUninterruptibly()if appropriate).
channelFuture = b.bind(0).sync();
InetSocketAddress address = (InetSocketAddress) channelFuture.channel().localAddress();
this.port = address.getPort();
return channelFuture;
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #2629
Fix flaky Azure filesystem ITs caused by the mock auth server binding to a fixed port. Use a random available port and wire it into the test configs to avoid port collisions in CI.
Brief change log
Bind MockAuthServer to an ephemeral port instead of hardcoded 8080
Expose the actual port via getPort()
Update AbfsFileSystemBehaviorITCase and AzureDelegationTokenProviderTest to use the dynamic endpoint
Tests
existing IT
API and Format
Documentation