This is an automated email from the ASF dual-hosted git repository.

yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git


The following commit(s) were added to refs/heads/main by this push:
     new 17f99e573 [ci] Fix AbfsFileSystemBehaviorITCase fails with "Bind 
Address already in use" in CI  (#2630)
17f99e573 is described below

commit 17f99e5734957bb8640c8e2a7c1aca792726245c
Author: litiliu <[email protected]>
AuthorDate: Thu Mar 12 12:04:41 2026 +0800

    [ci] Fix AbfsFileSystemBehaviorITCase fails with "Bind Address already in 
use" in CI  (#2630)
---
 .../apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java    |  6 ++++--
 .../fluss/fs/azure/token/AzureDelegationTokenProviderTest.java |  6 ++++--
 .../java/org/apache/fluss/fs/azure/token/MockAuthServer.java   | 10 +++++++++-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java
 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java
index 41d5846cc..6ea045436 100644
--- 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java
+++ 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemBehaviorITCase.java
@@ -38,7 +38,7 @@ class AbfsFileSystemBehaviorITCase extends 
FileSystemBehaviorTestSuite {
     private static final String CLIENT_SECRET = "testClientSecret";
 
     private static final String AZURE_ACCOUNT_KEY = "ZmFrZS1rZXkK";
-    private static final String ENDPOINT_KEY = "http://localhost:8080";;
+    private static final String ENDPOINT_PREFIX = "http://localhost:";;
     public static final String ABFS_FS_PATH = 
"abfs://[email protected]/test";
 
     private static MockAuthServer mockAuthServer;
@@ -49,7 +49,9 @@ class AbfsFileSystemBehaviorITCase extends 
FileSystemBehaviorTestSuite {
         final Configuration configuration = new Configuration();
         configuration.setString(CONFIG_PREFIX + ".oauth2.client.id", 
CLIENT_ID);
         configuration.setString(CONFIG_PREFIX + ".oauth2.client.secret", 
CLIENT_SECRET);
-        configuration.setString(CONFIG_PREFIX + ".oauth2.client.endpoint", 
ENDPOINT_KEY);
+        configuration.setString(
+                CONFIG_PREFIX + ".oauth2.client.endpoint",
+                ENDPOINT_PREFIX + mockAuthServer.getPort());
         configuration.setString(CONFIG_PREFIX + ".key", AZURE_ACCOUNT_KEY);
         FileSystem.initialize(configuration, null);
     }
diff --git 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenProviderTest.java
 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenProviderTest.java
index ad716e1c4..e037ccd48 100644
--- 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenProviderTest.java
+++ 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenProviderTest.java
@@ -37,13 +37,15 @@ public class AzureDelegationTokenProviderTest {
     private static final String TEST_CLIENT_ID = "testClientId";
     private static final String TEST_CLIENT_SECRET = "testClientSecret";
 
-    private static final String TEST_ENDPOINT = "http://localhost:8080";;
+    private static final String TEST_ENDPOINT_PREFIX = "http://localhost:";;
+    private static String testEndpoint;
 
     private static MockAuthServer mockAuthServer;
 
     @BeforeAll
     static void setup() {
         mockAuthServer = MockAuthServer.create();
+        testEndpoint = TEST_ENDPOINT_PREFIX + mockAuthServer.getPort();
     }
 
     @Test
@@ -51,7 +53,7 @@ public class AzureDelegationTokenProviderTest {
         Configuration configuration = new Configuration();
         configuration.set(CLIENT_ID, TEST_CLIENT_ID);
         configuration.set(CLIENT_SECRET, TEST_CLIENT_SECRET);
-        configuration.set(ENDPOINT_KEY, TEST_ENDPOINT);
+        configuration.set(ENDPOINT_KEY, testEndpoint);
         AzureDelegationTokenProvider azureDelegationTokenProvider =
                 new AzureDelegationTokenProvider("abfs", configuration);
         ObtainedSecurityToken obtainedSecurityToken =
diff --git 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java
 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java
index 318f1eaa7..12d49767b 100644
--- 
a/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java
+++ 
b/fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/token/MockAuthServer.java
@@ -32,6 +32,7 @@ import 
org.apache.fluss.shaded.netty4.io.netty.handler.logging.LogLevel;
 import org.apache.fluss.shaded.netty4.io.netty.handler.logging.LoggingHandler;
 
 import java.io.Closeable;
+import java.net.InetSocketAddress;
 
 /** Mock Netty Auth Server for facilitating the Azure auth token generation. */
 public class MockAuthServer implements Closeable {
@@ -40,6 +41,7 @@ public class MockAuthServer implements Closeable {
     private final EventLoopGroup workerGroup;
 
     private ChannelFuture channelFuture;
+    private int port;
 
     MockAuthServer(EventLoopGroup bossGroup, EventLoopGroup workerGroup) {
         this.bossGroup = bossGroup;
@@ -65,7 +67,9 @@ public class MockAuthServer implements Closeable {
                                 }
                             });
 
-            channelFuture = b.bind(8080).sync();
+            channelFuture = b.bind(0).sync();
+            InetSocketAddress address = (InetSocketAddress) 
channelFuture.channel().localAddress();
+            this.port = address.getPort();
             return channelFuture;
         } catch (InterruptedException e) {
             throw new RuntimeException(e);
@@ -76,6 +80,10 @@ public class MockAuthServer implements Closeable {
         return new MockAuthServer(new NioEventLoopGroup(1), new 
NioEventLoopGroup());
     }
 
+    public int getPort() {
+        return port;
+    }
+
     @Override
     public void close() {
         try {

Reply via email to