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 03f45f3ad51 Update the DMS replication_task_modified waiter states
(#74522)
03f45f3ad51 is described below
commit 03f45f3ad5170df1fe9804f0b9d05b8f874647c9
Author: D. Ferruzzi <[email protected]>
AuthorDate: Thu Oct 15 10:56:56 2026 -0700
Update the DMS replication_task_modified waiter states (#74522)
* Update the DMS replication_task_modified waiter states
---
.../airflow/providers/amazon/aws/waiters/dms.json | 4 +--
.../tests/unit/amazon/aws/waiters/test_dms.py | 36 +++++++++++++++-------
2 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/waiters/dms.json
b/providers/amazon/src/airflow/providers/amazon/aws/waiters/dms.json
index 72b342b90dd..b127ab7de70 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/waiters/dms.json
+++ b/providers/amazon/src/airflow/providers/amazon/aws/waiters/dms.json
@@ -141,13 +141,13 @@
"matcher": "path",
"argument": "ReplicationTasks[0].Status",
"expected": "running",
- "state": "failure"
+ "state": "success"
},
{
"matcher": "path",
"argument": "ReplicationTasks[0].Status",
"expected": "stopping",
- "state": "failure"
+ "state": "success"
},
{
"matcher": "path",
diff --git a/providers/amazon/tests/unit/amazon/aws/waiters/test_dms.py
b/providers/amazon/tests/unit/amazon/aws/waiters/test_dms.py
index 34b037f8f54..e4e4de54eea 100644
--- a/providers/amazon/tests/unit/amazon/aws/waiters/test_dms.py
+++ b/providers/amazon/tests/unit/amazon/aws/waiters/test_dms.py
@@ -152,16 +152,29 @@ class TestCustomDmsWaiters:
]
)
- @pytest.mark.parametrize("status", ["stopped", "ready", "failed"])
- def test_wait_for_replication_task_modified(self,
mock_describe_replication_tasks, status):
- mock_describe_replication_tasks.return_value = {
- "ReplicationTasks": [
- {
- "ReplicationTaskArn":
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
- "Status": status,
- }
- ]
- }
+ @pytest.mark.parametrize(
+ "statuses",
+ [
+ pytest.param(["stopped"], id="stopped"),
+ pytest.param(["ready"], id="ready"),
+ pytest.param(["failed"], id="failed"),
+ pytest.param(["running"], id="running"),
+ pytest.param(["stopping"], id="stopping"),
+ pytest.param(["modifying", "stopped"],
id="modifying-then-stopped"),
+ ],
+ )
+ def test_wait_for_replication_task_modified(self,
mock_describe_replication_tasks, statuses):
+ mock_describe_replication_tasks.side_effect = [
+ {
+ "ReplicationTasks": [
+ {
+ "ReplicationTaskArn":
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+ "Status": status,
+ }
+ ]
+ }
+ for status in statuses
+ ]
hook = DmsHook(aws_conn_id=None)
waiter = hook.get_waiter("replication_task_modified")
@@ -176,7 +189,8 @@ class TestCustomDmsWaiters:
WaiterConfig={"Delay": 0.01, "MaxAttempts": 3},
)
- mock_describe_replication_tasks.assert_called_once_with(
+ assert mock_describe_replication_tasks.call_count == len(statuses)
+ mock_describe_replication_tasks.assert_called_with(
Filters=[
{
"Name": "replication-task-arn",