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

w41ter 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 32877fef54f [fix](test) Buffer stdout/stderr to avoid blocking the 
curl command (#55469)
32877fef54f is described below

commit 32877fef54f4940f91cdbea05c01513e5b3d3bd3
Author: walter <[email protected]>
AuthorDate: Mon Sep 15 10:53:32 2025 +0800

    [fix](test) Buffer stdout/stderr to avoid blocking the curl command (#55469)
    
    Fix curl subprocess blocking by properly consuming output streams
    
    - Block occurs when stdout/stderr buffers fill up without being read
    - Used consumeProcessOutput() to continuously drain both streams
    - Maintained output capture while preventing process hangs
    - Ensures process completion isn't blocked by unread output
---
 regression-test/plugins/plugin_curl_requester.groovy       | 13 ++++++++++---
 .../compaction/test_compaction_fail_release_lock.groovy    | 14 ++++----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/regression-test/plugins/plugin_curl_requester.groovy 
b/regression-test/plugins/plugin_curl_requester.groovy
index 6fb76589fff..c1aece2db60 100644
--- a/regression-test/plugins/plugin_curl_requester.groovy
+++ b/regression-test/plugins/plugin_curl_requester.groovy
@@ -144,15 +144,22 @@ Suite.metaClass.curl = { String method, String url, 
String body = null, Integer
 
     while (retryCount < maxRetries) {
         process = cmd.execute()
-        code = process.waitFor()
-        err = IOGroovyMethods.getText(new BufferedReader(new 
InputStreamReader(process.getErrorStream())))
-        out = process.getText()
+
+        def outputGlobber = new ByteArrayOutputStream()
+        def errorGlobber = new ByteArrayOutputStream()
+        process.waitForProcessOutput(outputGlobber, errorGlobber)
+
+        code = process.exitValue()
+        err = errorGlobber.toString()
+        out = outputGlobber.toString()
 
         // If the command was successful, break the loop
         if (code == 0) {
             break
         }
 
+        logger.error("Command curl failed, code: " + code + ", err: " + err + 
", retry after " + sleepTime + " ms")
+
         // If the command was not successful, increment the retry count, sleep 
for a while and try again
         retryCount++
         sleep(sleepTime)
diff --git 
a/regression-test/suites/compaction/test_compaction_fail_release_lock.groovy 
b/regression-test/suites/compaction/test_compaction_fail_release_lock.groovy
index ccf8c7db451..6ce52179436 100644
--- a/regression-test/suites/compaction/test_compaction_fail_release_lock.groovy
+++ b/regression-test/suites/compaction/test_compaction_fail_release_lock.groovy
@@ -81,15 +81,12 @@ suite("test_compaction_fail_release_lock", "nonConcurrent") 
{
         boolean running = true
         Thread.sleep(1000)
         StringBuilder sb = new StringBuilder();
-        sb.append("curl -X GET http://${be_host}:${be_http_port}";)
+        sb.append("http://${be_host}:${be_http_port}";)
         sb.append("/api/compaction/show?tablet_id=")
         sb.append(tablet_id)
 
         String command = sb.toString()
-        logger.info(command)
-        def process = command.execute()
-        def code = process.waitFor()
-        def out = process.getText()
+        def (code, out, err) = curl('GET', command)
         logger.info("Get tablet status:  =" + code + ", out=" + out)
         assertEquals(code, 0)
         def tabletStatus = parseJson(out.trim())
@@ -101,15 +98,12 @@ suite("test_compaction_fail_release_lock", 
"nonConcurrent") {
         do {
             Thread.sleep(1000)
             StringBuilder sb = new StringBuilder();
-            sb.append("curl -X GET http://${be_host}:${be_http_port}";)
+            sb.append("http://${be_host}:${be_http_port}";)
             sb.append("/api/compaction/run_status?tablet_id=")
             sb.append(tablet_id)
 
             String command = sb.toString()
-            logger.info(command)
-            def process = command.execute()
-            def code = process.waitFor()
-            def out = process.getText()
+            def (code, out, err) = curl('GET', command)
             logger.info("Get compaction status: code=" + code + ", out=" + out)
             assertEquals(code, 0)
             def compactionStatus = parseJson(out.trim())


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

Reply via email to