Skip to content

Commit

Permalink
[FLINK-23418][e2e] Increase the timeout to make kubernetes applicatio…
Browse files Browse the repository at this point in the history
…n ha test more stable

This closes apache#16602.
  • Loading branch information
wangyang0918 committed Jul 28, 2021
1 parent 4f96ac4 commit b296738
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions flink-end-to-end-tests/test-scripts/common_kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ function wait_num_checkpoints {
function wait_for_logs {
local jm_pod_name=$1
local successful_response_regex=$2
local timeout=${3:-30}

echo "Waiting for jobmanager pod ${jm_pod_name} ready."
kubectl wait --for=condition=Ready --timeout=30s pod/$jm_pod_name || exit 1
kubectl wait --for=condition=Ready --timeout=${timeout}s pod/$jm_pod_name || exit 1

# wait at most 30 seconds until the log shows up
local TIMEOUT=30
# wait or timeout until the log shows up
echo "Waiting for log \"$2\"..."
for i in $(seq 1 ${TIMEOUT}); do
for i in $(seq 1 ${timeout}); do
if check_logs_output $jm_pod_name $successful_response_regex; then
echo "Log \"$2\" shows up."
return
fi

sleep 1
done
echo "Log $2 does not show up within a timeout of ${TIMEOUT} sec"
echo "Log $2 does not show up within a timeout of ${timeout} sec"
exit 1
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ job_id=$(kubectl logs $jm_pod_name | grep -E -o 'Job [a-z0-9]+ is submitted' | a
kubectl exec $jm_pod_name -- /bin/sh -c "kill 1"

# Check the new JobManager recovering from latest successful checkpoint
wait_for_logs $jm_pod_name "Restoring job $job_id from Checkpoint"
wait_for_logs $jm_pod_name "Restoring job $job_id from Checkpoint" 120
wait_num_checkpoints $jm_pod_name 1

"$FLINK_DIR"/bin/flink cancel -t kubernetes-application -Dkubernetes.cluster-id=${CLUSTER_ID} $job_id
Expand Down

0 comments on commit b296738

Please sign in to comment.