This is an automated email from the ASF dual-hosted git repository.

ferruzzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 86193f5608 Increase the number of attempts in AWS system test 
`example_rds_export` (#32976)
86193f5608 is described below

commit 86193f560815507b9abf1008c19b133d95c4da9f
Author: Vincent <97131062+vincb...@users.noreply.github.com>
AuthorDate: Mon Jul 31 15:18:57 2023 -0400

    Increase the number of attempts in AWS system test `example_rds_export` 
(#32976)
---
 airflow/providers/amazon/aws/operators/rds.py           | 9 ++++++++-
 tests/system/providers/amazon/aws/example_rds_export.py | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/amazon/aws/operators/rds.py 
b/airflow/providers/amazon/aws/operators/rds.py
index 7a544a8c00..a4a2ac5c33 100644
--- a/airflow/providers/amazon/aws/operators/rds.py
+++ b/airflow/providers/amazon/aws/operators/rds.py
@@ -392,6 +392,8 @@ class RdsCancelExportTaskOperator(RdsBaseOperator):
 
     :param export_task_identifier: The identifier of the snapshot export task 
to cancel
     :param wait_for_completion:  If True, waits for DB snapshot export to 
cancel. (default: True)
+    :param check_interval: The amount of time in seconds to wait between 
attempts
+    :param max_attempts: The maximum number of attempts to be made
     """
 
     template_fields = ("export_task_identifier",)
@@ -402,6 +404,7 @@ class RdsCancelExportTaskOperator(RdsBaseOperator):
         export_task_identifier: str,
         wait_for_completion: bool = True,
         check_interval: int = 30,
+        max_attempts: int = 40,
         **kwargs,
     ):
         super().__init__(**kwargs)
@@ -409,6 +412,7 @@ class RdsCancelExportTaskOperator(RdsBaseOperator):
         self.export_task_identifier = export_task_identifier
         self.wait_for_completion = wait_for_completion
         self.check_interval = check_interval
+        self.max_attempts = max_attempts
 
     def execute(self, context: Context) -> str:
         self.log.info("Canceling export task %s", self.export_task_identifier)
@@ -419,7 +423,10 @@ class RdsCancelExportTaskOperator(RdsBaseOperator):
 
         if self.wait_for_completion:
             self.hook.wait_for_export_task_state(
-                self.export_task_identifier, target_state="canceled", 
check_interval=self.check_interval
+                self.export_task_identifier,
+                target_state="canceled",
+                check_interval=self.check_interval,
+                max_attempts=self.max_attempts,
             )
         return json.dumps(cancel_export, default=str)
 
diff --git a/tests/system/providers/amazon/aws/example_rds_export.py 
b/tests/system/providers/amazon/aws/example_rds_export.py
index d103763952..a87bce10de 100644
--- a/tests/system/providers/amazon/aws/example_rds_export.py
+++ b/tests/system/providers/amazon/aws/example_rds_export.py
@@ -128,6 +128,7 @@ with DAG(
     )
     # [END howto_operator_rds_cancel_export]
     cancel_export.check_interval = 10
+    cancel_export.max_attempts = 120
 
     # [START howto_sensor_rds_export_task_existence]
     export_sensor = RdsExportTaskExistenceSensor(

Reply via email to