Skip to content

Commit

Permalink
[opt](test)turn up the timeout of http request
Browse files Browse the repository at this point in the history
  • Loading branch information
qidaye committed Aug 8, 2024
1 parent df55639 commit 9a1f908
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion regression-test/plugins/plugin_curl_requester.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Suite.metaClass.http_client = { String method, String url /* param */ ->
throw new Exception("Invalid url: ${url}")
}

Integer timeout = 60 // seconds
Integer timeout = 300 // seconds
Integer maxRetries = 10
Integer retryCount = 0
Integer sleepTime = 1000 // milliseconds
Expand Down Expand Up @@ -90,6 +90,7 @@ Suite.metaClass.http_client = { String method, String url /* param */ ->
timeout = timeout + 10
logger.warn("Read timed out, retrying (${++retryCount}/${maxRetries}): ${e.message}")
} catch (Exception e) {
code = 500 // Internal Server Error
logger.error("Error executing HTTP request: ${e.message}")
err = e.message
return [code, out, err]
Expand All @@ -101,6 +102,7 @@ Suite.metaClass.http_client = { String method, String url /* param */ ->

logger.error("HTTP request failed after ${maxRetries} attempts")
err = "Failed after ${maxRetries} attempts"
code = 500 // Internal Server Error
return [code, out, err]
} finally {
httpClient.close()
Expand Down

0 comments on commit 9a1f908

Please sign in to comment.