syedahsn commented on code in PR #38658:
URL: https://github.com/apache/airflow/pull/38658#discussion_r1603754080


##########
tests/providers/amazon/aws/sensors/test_emr_containers.py:
##########
@@ -84,3 +84,17 @@ def test_sensor_defer(self, mock_poke):
         assert isinstance(
             e.value.trigger, EmrContainerTrigger
         ), f"{e.value.trigger} is not a EmrContainerTrigger"
+
+    
@mock.patch("airflow.providers.amazon.aws.sensors.emr.EmrContainerSensor.poke")
+    def test_sensor_defer_with_timeout(self, mock_poke):
+        self.sensor.deferrable = True
+        mock_poke.return_value = False
+        self.sensor.max_retries = 1000
+
+        with pytest.raises(TaskDeferred) as e:
+            self.sensor.execute(context=None)
+
+        trigger = e.value.trigger
+        assert isinstance(trigger, EmrContainerTrigger), f"{trigger} is not a 
EmrContainerTrigger"
+        assert trigger.waiter_delay == self.sensor.poll_interval

Review Comment:
   Nice! This looks great.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to