Skip to content

Commit

Permalink
Fix delete_cluster no use TriggerRule.ALL_DONE (#24213)
Browse files Browse the repository at this point in the history
related: #24082
  • Loading branch information
chenglongyan committed Jun 6, 2022
1 parent 41898d8 commit 550d1a5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/system/providers/yandex/example_yandexcloud_dataproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
DataprocDeleteClusterOperator,
)

# Name of the datacenter where Dataproc cluster will be created
from airflow.utils.trigger_rule import TriggerRule

# should be filled with appropriate ids

# Name of the datacenter where Dataproc cluster will be created

AVAILABILITY_ZONE_ID = 'ru-central1-c'

# Dataproc cluster jobs will produce logs in specified s3 bucket
Expand Down Expand Up @@ -151,12 +154,18 @@
)

delete_cluster = DataprocDeleteClusterOperator(
task_id='delete_cluster',
task_id='delete_cluster', trigger_rule=TriggerRule.ALL_DONE
)

create_cluster >> create_mapreduce_job >> create_hive_query >> create_hive_query_from_file
create_hive_query_from_file >> create_spark_job >> create_pyspark_job >> delete_cluster

from tests.system.utils.watcher import watcher

# This test needs watcher in order to properly mark success/failure
# when "teardown" task with trigger rule is part of the DAG
list(dag.tasks) >> watcher()

from tests.system.utils import get_test_run # noqa: E402

# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)
Expand Down

0 comments on commit 550d1a5

Please sign in to comment.