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

hello-stephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e38455feb61 [fix](regression) Handle loopback export hosts locally 
(#65444)
e38455feb61 is described below

commit e38455feb61d5cbf68ce5a5321591b91ba5961af
Author: shuke <[email protected]>
AuthorDate: Wed Jul 15 16:57:01 2026 +0800

    [fix](regression) Handle loopback export hosts locally (#65444)
    
    Problem Summary:
    
    `ExportTestHelper` always used SSH and SCP for every backend host,
    including loopback addresses. In Cloud P0 build 990900,
    `test_outfile_agg_state` received `127.0.0.1` from `SHOW BACKENDS` and
    failed before running its product assertions because the helper's SSH
    directory creation returned exit code 255.
    
    Handle `127.0.0.1`, `localhost`, and `::1` with local filesystem
    commands while preserving the existing SSH/SCP path for remote backend
    hosts. Also report the command result's actual `stderr` field so future
    failures keep their diagnostic message.
---
 .../regression/util/RemoteFileOperator.groovy      | 32 ++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/RemoteFileOperator.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/RemoteFileOperator.groovy
index 13f404f928d..585b387bd00 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/RemoteFileOperator.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/RemoteFileOperator.groovy
@@ -100,7 +100,7 @@ class RemoteFileOperator {
             }
             
             if (execResult.exitCode != 0) {
-                def errorMsg = "Failed to create directory on ${host} (exit 
code: ${execResult.exitCode}): ${execResult.error}"
+                def errorMsg = "Failed to create directory on ${host} (exit 
code: ${execResult.exitCode}): ${execResult.stderr}"
                 logger.error(errorMsg)
                 throw new Exception(errorMsg)
             }
@@ -140,7 +140,9 @@ class RemoteFileOperator {
         hosts.each { host ->
             // Step 1: Check if remote directory has files (count regular 
files only)
             // scp user@host:/tmp/doristest/* will fail if doristest has no 
files.
-            String countCommand = """ssh -p ${port} ${username}@${host} "find 
${escapePath(remoteDir)} -maxdepth 1 -type f | wc -l" """
+            String countCommand = isLocalHost(host)
+                    ? "find ${escapePath(remoteDir)} -maxdepth 1 -type f | wc 
-l"
+                    : """ssh -p ${port} ${username}@${host} "find 
${escapePath(remoteDir)} -maxdepth 1 -type f | wc -l" """
             def countResult = executeLocalCommand(countCommand)
             
             if (countResult.timedOut) {
@@ -150,7 +152,7 @@ class RemoteFileOperator {
             }
             
             if (countResult.exitCode != 0) {
-                def errorMsg = "Failed to check file count on ${host} (exit 
code: ${countResult.exitCode}): ${countResult.error}"
+                def errorMsg = "Failed to check file count on ${host} (exit 
code: ${countResult.exitCode}): ${countResult.stderr}"
                 logger.error(errorMsg)
                 throw new Exception(errorMsg)
             }
@@ -163,9 +165,16 @@ class RemoteFileOperator {
             if (fileCount > 0) {
                 logger.info("Downloading ${fileCount} files from 
${host}:${remoteDir} to ${localBaseDir}")
 
-                def normalizedRemoteDir = (remoteDir.endsWith('/') ? remoteDir 
: "${remoteDir}/") + "*"
-                def scpCommand = "scp -P ${port} 
${username}@${host}:${escapePath(normalizedRemoteDir)} 
${escapePath(localBaseDir)}"
-                def execResult = executeLocalCommand(scpCommand)
+                def copyCommand
+                if (isLocalHost(host)) {
+                    copyCommand = "find ${escapePath(remoteDir)} -maxdepth 1 
-type f " +
+                            "-exec cp -f '{}' ${escapePath(localBaseDir)} ';'"
+                } else {
+                    def normalizedRemoteDir = (remoteDir.endsWith('/') ? 
remoteDir : "${remoteDir}/") + "*"
+                    copyCommand = "scp -P ${port} 
${username}@${host}:${escapePath(normalizedRemoteDir)} " +
+                            escapePath(localBaseDir)
+                }
+                def execResult = executeLocalCommand(copyCommand)
 
                 if (execResult.timedOut) {
                     def errorMsg = "Timeout downloading from ${host} 
(${timeout}ms)"
@@ -174,7 +183,7 @@ class RemoteFileOperator {
                 }
 
                 if (execResult.exitCode != 0) {
-                    def errorMsg = "Failed to download from ${host} (exit 
code: ${execResult.exitCode}): ${execResult.error}"
+                    def errorMsg = "Failed to download from ${host} (exit 
code: ${execResult.exitCode}): ${execResult.stderr}"
                     logger.error(errorMsg)
                     throw new Exception(errorMsg)
                 }
@@ -214,7 +223,7 @@ class RemoteFileOperator {
             }
             
             if (execResult.exitCode != 0) {
-                def errorMsg = "Failed to delete directory on ${host} (exit 
code: ${execResult.exitCode}): ${execResult.error}"
+                def errorMsg = "Failed to delete directory on ${host} (exit 
code: ${execResult.exitCode}): ${execResult.stderr}"
                 logger.error(errorMsg)
                 throw new Exception(errorMsg)
             }
@@ -224,10 +233,17 @@ class RemoteFileOperator {
     }
 
     private Map executeSshCommand(String host, String command) {
+        if (isLocalHost(host)) {
+            return executeLocalCommand(command)
+        }
         def sshCommand = "ssh -p ${port} ${username}@${host} '${command}'"
         return executeLocalCommand(sshCommand)
     }
 
+    private boolean isLocalHost(String host) {
+        return host in ["127.0.0.1", "localhost", "::1"]
+    }
+
     private Map executeLocalCommand(String command) {
         def result = [
             exitCode: -1,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to