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 2020/01/03 03:49:49 UTC

[GitHub] [flink] KarmaGYZ commented on a change in pull request #10666: [FLINK-15214] Introduce multiple submission e2e test

KarmaGYZ commented on a change in pull request #10666: [FLINK-15214] Introduce multiple submission e2e test
URL: https://github.com/apache/flink/pull/10666#discussion_r362700324
 
 

 ##########
 File path: flink-end-to-end-tests/test-scripts/test_mesos_multi_submission.sh
 ##########
 @@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+set -o pipefail
+
+source "$(dirname "$0")"/common.sh
+source "$(dirname "$0")"/common_mesos_docker.sh
+
+FIRST_DURATION=15
+SECOND_DURATION=5
+CPUS=$(lscpu | grep "^CPU(s):" | awk '{print $2}')
+FIRST_OUTPUT_LOCATION="${TEST_DATA_DIR}/out/first_out"
+SECOND_OUTPUT_LOCATION="${TEST_DATA_DIR}/out/second_out"
+TEST_PROGRAM_JAR=$END_TO_END_DIR/flink-cli-test/target/PeriodicStreamingJob.jar
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+    CPUS=$(lscpu | grep "^CPU(s):" | awk '{print $2}')
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+    CPUS=$(sysctl -n hw.ncpu)
+else
+    echo "Could not verify the OS type."
+    exit 1
+fi
+
+
+mkdir -p "${TEST_DATA_DIR}"
+
+# There should be only one TaskManager with one slot; Thus, there are not enough resources to allocate a complete new set of slots for the second job.
+# To ensure the old slots are being reused.
+set_config_key "mesos.resourcemanager.tasks.cpus" "${CPUS}"
+
+start_flink_cluster_with_mesos
+
+JOB1_ID=$(docker exec -it mesos-master bash -c "${FLINK_DIR}/bin/flink run -d -p 1 ${TEST_PROGRAM_JAR} --durationInSecond ${FIRST_DURATION} --outputPath ${FIRST_OUTPUT_LOCATION}" \
+        | grep "Job has been submitted with JobID" | sed 's/.* //g' | tr -d '\r')
+
+wait_num_of_occurence_in_logs_mesos "switched from DEPLOYING to RUNNING" 1
 
 Review comment:
   I think it better to add this check to ensure the first job already occupy the slot and the second job need to wait for that slot to be free.
   If you think it's fragile, I'd like to harden this function. But so far, I do not figure out the fragile point here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services