zhuzhurk commented on code in PR #21559:
URL: https://github.com/apache/flink/pull/21559#discussion_r1057175134


##########
flink-end-to-end-tests/test-scripts/test-runner-common.sh:
##########
@@ -58,23 +59,28 @@ function run_test {
     exit_code="$?"
     # remove trap for test execution
     trap - ERR
-    post_test_validation ${exit_code} "$description" "$skip_check_exceptions"
+    post_test_validation ${exit_code} "$description" 
"$check_exceptions_action" "$check_command"
 }
 
 # Validates the test result and exit code after its execution.
 function post_test_validation {
     local exit_code="$1"
     local description="$2"
-    local skip_check_exceptions="$3"
+    local check_exceptions_action="$3"
 
     local time_elapsed=$(end_timer)
 
-    if [[ "${skip_check_exceptions}" != "skip_check_exceptions" ]]; then
+    if [[ "${check_exceptions_action}" == "skip_check_exceptions" ]]; then
+        echo "Checking of logs skipped."
+    elif [[ "${check_exceptions_action}" == "custom_check_exceptions" ]]; then
+        echo "Custom exception checking of logs."
+        local check_command="$4"

Review Comment:
   It's better to define it at the beginning of the method to clearly show all 
the params.



##########
flink-end-to-end-tests/test-scripts/test_tpcds.sh:
##########
@@ -24,86 +24,153 @@ USE_TABLE_STATS=true
 
 source "$(dirname "$0")"/common.sh
 
-################################################################################
-# Generate test data
-################################################################################
-TPCDS_TOOL_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool"
-ORGIN_ANSWER_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool/answer_set"
-TPCDS_QUERY_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool/query"
-
-TARGET_DIR="$END_TO_END_DIR/flink-tpcds-test/target"
-
-TPCDS_GENERATOR_DIR_DIR="$TARGET_DIR/generator"
-TPCDS_DATA_DIR="$TARGET_DIR/table"
-
-mkdir -p "$TPCDS_GENERATOR_DIR_DIR"
-mkdir -p "$TPCDS_DATA_DIR"
-
-cd "$TPCDS_TOOL_DIR"
-# use relative path, because tpcds gennerator cannot recognize path which is 
too long.
-TPCDS_GENERATOR_RELATIVE_DIR="../target/generator"
-TPCDS_DATA_RELATIVE_DIR="../table"
-
-${TPCDS_TOOL_DIR}/data_generator.sh "$TPCDS_GENERATOR_RELATIVE_DIR" "$SCALE" 
"$TPCDS_DATA_RELATIVE_DIR" "$END_TO_END_DIR/test-scripts"
-
-cd "$END_TO_END_DIR"
-
-################################################################################
-# Prepare Flink
-################################################################################
-
-echo "[INFO]Preparing Flink cluster..."
+function run_test() {
+    
################################################################################
+    # Generate test data
+    
################################################################################
+    TPCDS_TOOL_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool"
+    ORGIN_ANSWER_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool/answer_set"
+    TPCDS_QUERY_DIR="$END_TO_END_DIR/flink-tpcds-test/tpcds-tool/query"
+
+    TARGET_DIR="$END_TO_END_DIR/flink-tpcds-test/target"
+
+    TPCDS_GENERATOR_DIR_DIR="$TARGET_DIR/generator"
+    TPCDS_DATA_DIR="$TARGET_DIR/table"
+
+    mkdir -p "$TPCDS_GENERATOR_DIR_DIR"
+    mkdir -p "$TPCDS_DATA_DIR"
+
+    cd "$TPCDS_TOOL_DIR"
+    # use relative path, because tpcds gennerator cannot recognize path which 
is too long.
+    TPCDS_GENERATOR_RELATIVE_DIR="../target/generator"
+    TPCDS_DATA_RELATIVE_DIR="../table"
+
+    ${TPCDS_TOOL_DIR}/data_generator.sh "$TPCDS_GENERATOR_RELATIVE_DIR" 
"$SCALE" "$TPCDS_DATA_RELATIVE_DIR" "$END_TO_END_DIR/test-scripts"
+
+    cd "$END_TO_END_DIR"
+
+    
################################################################################
+    # Prepare Flink
+    
################################################################################
+
+    echo "[INFO]Preparing Flink cluster..."
+
+    local scheduler="$1"
+
+    set_config_key "jobmanager.scheduler" "${scheduler}"
+    set_config_key "taskmanager.memory.process.size" "4096m"
+    set_config_key "taskmanager.memory.network.fraction" "0.2"
+
+    if [ "${scheduler}" == "Default" ]; then
+        set_config_key "taskmanager.numberOfTaskSlots" "4"
+        set_config_key "parallelism.default" "4"
+    elif [ "${scheduler}" == "AdaptiveBatch" ]; then
+        set_config_key "taskmanager.numberOfTaskSlots" "8"
+        set_config_key "parallelism.default" "-1"
+        set_config_key "jobmanager.adaptive-batch-scheduler.max-parallelism" 
"8"
+        set_config_key 
"jobmanager.adaptive-batch-scheduler.avg-data-volume-per-task" "6m"
+        set_config_key 
"jobmanager.adaptive-batch-scheduler.speculative.enabled" "true"
+        set_config_key 
"jobmanager.adaptive-batch-scheduler.speculative.block-slow-node-duration" "0s"
+        set_config_key "slow-task-detector.execution-time.baseline-ratio" "0.0"
+        set_config_key 
"slow-task-detector.execution-time.baseline-lower-bound" "0s"
+    else
+        echo "ERROR: Scheduler ${scheduler} is unsupported for tpcds test. 
Aborting..."
+        exit 1
+    fi
+
+    start_cluster
+
+
+    
################################################################################
+    # Run TPC-DS SQL
+    
################################################################################
+
+    echo "[INFO] Runing TPC-DS queries..."
+
+    RESULT_DIR="$TARGET_DIR/result"
+    mkdir -p "$RESULT_DIR"
+
+    $FLINK_DIR/bin/flink run -c org.apache.flink.table.tpcds.TpcdsTestProgram 
"$TARGET_DIR/TpcdsTestProgram.jar" -sourceTablePath "$TPCDS_DATA_DIR" 
-queryPath "$TPCDS_QUERY_DIR" -sinkTablePath "$RESULT_DIR" -useTableStats 
"$USE_TABLE_STATS"
+
+    
################################################################################
+    # validate result
+    
################################################################################
+    QUALIFIED_ANSWER_DIR="$TARGET_DIR/answer_set_qualified"
+    mkdir -p "$QUALIFIED_ANSWER_DIR"
+
+    java -cp "$TARGET_DIR/TpcdsTestProgram.jar:$TARGET_DIR/lib/*" 
org.apache.flink.table.tpcds.utils.AnswerFormatter -originDir 
"$ORGIN_ANSWER_DIR" -destDir "$QUALIFIED_ANSWER_DIR"
+
+    java -cp "$TARGET_DIR/TpcdsTestProgram.jar:$TARGET_DIR/lib/*" 
org.apache.flink.table.tpcds.utils.TpcdsResultComparator -expectedDir 
"$QUALIFIED_ANSWER_DIR" -actualDir "$RESULT_DIR"
+
+    
################################################################################
+    # Clean-up generated data folder
+    
################################################################################
+
+    rm -rf "${TPCDS_DATA_DIR}"
+    echo "Deleted all files under $TPCDS_DATA_DIR"
+}
+
+function check_logs_for_exceptions_for_adaptive_batch_scheduler {
+    echo "Checking for exceptions for adaptive batch scheduler..."
+    exception_count=$(grep -rv "GroupCoordinatorNotAvailableException" 
$FLINK_LOG_DIR \

Review Comment:
   It is possible to re-use the whitelisted exceptions in 
`check_logs_for_exceptions`, in `common.sh`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to