|
20 | 20 | # This script tests basic Flink batch job operations on Kubernetes: |
21 | 21 | # 1. Deploys a FlinkDeployment for a batch job. |
22 | 22 | # 2. Waits for the JobManager to become ready. |
23 | | -# 3. Verifies that the job reaches the FINISHED state (first check). |
24 | | -# 4. Sleeps for a configurable duration to test for state persistence. |
25 | | -# 5. Verifies that the job remains in the FINISHED state (second check). |
26 | | -# 6. Checks the operator logs for the expected job state transition message. |
27 | | -# 7. Checks the JobManager logs for successful application completion. |
28 | | -# 8. Applies a spec change to the FlinkDeployment and verifies the job re-runs successfully. |
| 23 | +# 3. Verifies that the job reaches the FINISHED state. |
| 24 | +# 4. Applies a no-op spec change and verifies the job remains in the FINISHED state. |
| 25 | +# 5. Checks the operator logs for the expected job state transition message. |
| 26 | +# 6. Checks the JobManager logs for successful application completion. |
| 27 | +# 7. Applies a spec change and verifies the job re-runs successfully. |
29 | 28 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") |
30 | 29 | source "${SCRIPT_DIR}/utils.sh" |
31 | 30 |
|
32 | 31 | CLUSTER_ID="flink-example-wordcount-batch" |
33 | 32 | APPLICATION_YAML="${SCRIPT_DIR}/data/flinkdep-batch-cr.yaml" |
34 | 33 | APPLICATION_IDENTIFIER="flinkdep/$CLUSTER_ID" |
35 | 34 | TIMEOUT=300 |
36 | | -SLEEP_DURATION=30 |
37 | 35 |
|
38 | 36 | on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID |
39 | 37 |
|
40 | 38 | retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1 |
41 | 39 |
|
42 | 40 | wait_for_jobmanager_running $CLUSTER_ID $TIMEOUT |
43 | 41 |
|
44 | | -# Wait for the job to reach the FINISHED state (first check). |
| 42 | +# Wait for the job to reach the FINISHED state. |
45 | 43 | wait_for_status $APPLICATION_IDENTIFIER '.status.jobStatus.state' FINISHED $TIMEOUT || exit 1 |
46 | 44 |
|
47 | | -echo "Job reached FINISHED state. Sleeping for $SLEEP_DURATION seconds..." |
48 | | -sleep "$SLEEP_DURATION" |
49 | | - |
50 | | -# Verify the job is *still* in the FINISHED state (second check). |
| 45 | +# Apply a no-op spec change; verify the job remains in the FINISHED state. |
| 46 | +kubectl patch flinkdep ${CLUSTER_ID} --type merge --patch '{"spec":{"flinkConfiguration": {"kubernetes.operator.deployment.readiness.timeout": "6h" } } }' |
51 | 47 | wait_for_status $APPLICATION_IDENTIFIER '.status.jobStatus.state' FINISHED $TIMEOUT || exit 1 |
52 | 48 |
|
53 | 49 | # Verify the job status change to FINISHED shows up in the operator logs. |
|
0 commit comments