Skip to content

[Fix][UT]Fix AbfsFileSystemBehaviorITCase fails with "Bind Address already in use" in CI #2630

Open
litiliu wants to merge 2 commits intoapache:mainfrom
litiliu:codex/Fix-AbfsFileSystemBehaviorITCase
Open

[Fix][UT]Fix AbfsFileSystemBehaviorITCase fails with "Bind Address already in use" in CI #2630
litiliu wants to merge 2 commits intoapache:mainfrom
litiliu:codex/Fix-AbfsFileSystemBehaviorITCase

Conversation

@litiliu
Copy link

@litiliu litiliu commented Feb 10, 2026

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

@litiliu litiliu marked this pull request as ready for review February 10, 2026 08:37
@litiliu
Copy link
Author

litiliu commented Feb 10, 2026

@luoyuxia please approve the workflows.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 MockAuthServer to an ephemeral port (bind(0)) and expose the selected port via getPort().
  • 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() catches InterruptedException and immediately wraps it in a RuntimeException without restoring the thread interrupt flag. This can cause higher-level test/framework code to miss the interrupt signal. Consider calling Thread.currentThread().interrupt() before rethrowing (or use syncUninterruptibly() 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.

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.

AbfsFileSystemBehaviorITCase fails with "Bind Address already in use" in CI

1 participant