You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/07 11:24:10 UTC

[GitHub] [flink] dmvk commented on a change in pull request #18298: [FLINK-25307][Test] Print the curl logs is querying dispatcher startup failed

dmvk commented on a change in pull request #18298:
URL: https://github.com/apache/flink/pull/18298#discussion_r780201566



##########
File path: flink-end-to-end-tests/test-scripts/common.sh
##########
@@ -274,13 +274,20 @@ function wait_rest_endpoint_up {
   # wait at most 30 seconds until the endpoint is up
   local TIMEOUT=30
   for i in $(seq 1 ${TIMEOUT}); do
+    local log_file=$(mktemp)
     # without the || true this would exit our script if the endpoint is not yet up
-    QUERY_RESULT=$(curl ${CURL_SSL_ARGS} "$query_url" 2> /dev/null || true)
+    QUERY_RESULT=$(curl -v ${CURL_SSL_ARGS} "$query_url" 2>${log_file} || true)

Review comment:
       nit
   
   ```suggestion
       QUERY_RESULT=$(curl -v ${CURL_SSL_ARGS} "$query_url" 2> ${log_file} || true)
   ```

##########
File path: flink-end-to-end-tests/test-scripts/common.sh
##########
@@ -274,13 +274,20 @@ function wait_rest_endpoint_up {
   # wait at most 30 seconds until the endpoint is up
   local TIMEOUT=30
   for i in $(seq 1 ${TIMEOUT}); do
+    local log_file=$(mktemp)
     # without the || true this would exit our script if the endpoint is not yet up
-    QUERY_RESULT=$(curl ${CURL_SSL_ARGS} "$query_url" 2> /dev/null || true)
+    QUERY_RESULT=$(curl -v ${CURL_SSL_ARGS} "$query_url" 2>${log_file} || true)
 
     # ensure the response adapts with the successful regex
     if [[ ${QUERY_RESULT} =~ ${successful_response_regex} ]]; then
       echo "${endpoint_name} REST endpoint is up."
       return
+    elif [ -f $log_file ];then

Review comment:
       this condition always succeeds

##########
File path: flink-end-to-end-tests/test-scripts/common.sh
##########
@@ -274,13 +274,20 @@ function wait_rest_endpoint_up {
   # wait at most 30 seconds until the endpoint is up
   local TIMEOUT=30
   for i in $(seq 1 ${TIMEOUT}); do
+    local log_file=$(mktemp)
     # without the || true this would exit our script if the endpoint is not yet up
-    QUERY_RESULT=$(curl ${CURL_SSL_ARGS} "$query_url" 2> /dev/null || true)
+    QUERY_RESULT=$(curl -v ${CURL_SSL_ARGS} "$query_url" 2>${log_file} || true)
 
     # ensure the response adapts with the successful regex
     if [[ ${QUERY_RESULT} =~ ${successful_response_regex} ]]; then
       echo "${endpoint_name} REST endpoint is up."
       return
+    elif [ -f $log_file ];then
+      echo "***************** Curl detailed output *****************"
+      echo "QUERY_RESULT is ${QUERY_RESULT}"
+      cat ${log_file}
+      echo "********************************************************"
+      rm ${log_file}
     fi

Review comment:
       Should the log file be cleaned up either way?
   
   ```suggestion
       fi
       
       rm ${log_file}
   ```
   
   https://linux.die.net/man/1/mktemp




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org