From 925ee167df8384c5284fff8ddc79f60709c801e5 Mon Sep 17 00:00:00 2001 From: Syed Hussain Date: Wed, 21 Sep 2022 15:31:36 -0700 Subject: [PATCH] Remove S3KeysUnchangedSensor from system test because it can only be run in poke mode, which causes it to fail in the system tests --- tests/system/providers/amazon/aws/example_s3.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/system/providers/amazon/aws/example_s3.py b/tests/system/providers/amazon/aws/example_s3.py index d24ad72029141..7a5e7294aa2a0 100644 --- a/tests/system/providers/amazon/aws/example_s3.py +++ b/tests/system/providers/amazon/aws/example_s3.py @@ -20,6 +20,7 @@ from airflow.models.baseoperator import chain from airflow.models.dag import DAG +from airflow.operators.python import BranchPythonOperator from airflow.providers.amazon.aws.operators.s3 import ( S3CopyObjectOperator, S3CreateBucketOperator, @@ -202,6 +203,12 @@ def check_fn(files: list) -> bool: ) # [END howto_operator_s3_file_transform] + # This task skips the `sensor_keys_unchanged` task because the S3KeysUnchangedSensor + # runs in poke mode only, which is not supported by the DebugExecutor, causing system tests to fail. + branching = BranchPythonOperator( + task_id='branch_to_delete_objects', python_callable=lambda: 'delete_objects' + ) + # [START howto_sensor_s3_keys_unchanged] sensor_keys_unchanged = S3KeysUnchangedSensor( task_id="sensor_keys_unchanged", @@ -218,6 +225,7 @@ def check_fn(files: list) -> bool: keys=key_2, ) # [END howto_operator_s3_delete_objects] + delete_objects.trigger_rule = TriggerRule.ALL_DONE # [START howto_operator_s3_delete_bucket] delete_bucket = S3DeleteBucketOperator( @@ -251,6 +259,7 @@ def check_fn(files: list) -> bool: [sensor_one_key, sensor_two_keys, sensor_key_with_function], copy_object, file_transform, + branching, sensor_keys_unchanged, # TEST TEARDOWN delete_objects,