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 2018/11/08 14:29:23 UTC

[GitHub] pnowojski commented on a change in pull request #7060: [FLINK-10801][e2e] Retry verify_result_hash in elastichsearch-common

pnowojski commented on a change in pull request #7060: [FLINK-10801][e2e] Retry verify_result_hash in elastichsearch-common
URL: https://github.com/apache/flink/pull/7060#discussion_r231908066
 
 

 ##########
 File path: flink-end-to-end-tests/test-scripts/elasticsearch-common.sh
 ##########
 @@ -83,23 +83,33 @@ function verify_result_hash {
   local name=$1
   local index=$2
   local numRecords=$3
-  local hash=$4
+  local expectedHash=$4
 
-  while : ; do
+  local error_code=0
+
+  for i in {1..30}; do
+    echo "Result verification attempt $i..."
     curl "localhost:9200/${index}/_search?q=*&pretty" > $TEST_DATA_DIR/es_output || true
 
-    if [ -n "$(grep "\"total\" : $numRecords" $TEST_DATA_DIR/es_output)" ]; then
-      break
-    else
-      echo "Waiting for Elasticsearch records ..."
+    # remove meta information
+    sed '2,9d' $TEST_DATA_DIR/es_output > $TEST_DATA_DIR/es_content
+
+    check_result_hash_no_exit "$name" $TEST_DATA_DIR/es_content "$expectedHash" || result=$?
 
 Review comment:
   good catch... I forgot to re-test failure case after renaming the variable

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services