You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/11/25 10:15:09 UTC

[GitHub] [airflow] msumit commented on a change in pull request #6654: AIRFLOW-6055: Option for exponential backoff in Sensors

msumit commented on a change in pull request #6654: AIRFLOW-6055: Option for exponential backoff in Sensors
URL: https://github.com/apache/airflow/pull/6654#discussion_r350092496
 
 

 ##########
 File path: tests/sensors/test_base_sensor.py
 ##########
 @@ -502,3 +502,28 @@ def test_sensor_with_invalid_timeout(self):
             return_value=None,
             poke_interval=10,
             timeout=positive_timeout)
+
+    def test_sensor_with_exponential_backoff_off(self):
+        sensor = self._make_sensor(
+            return_value=None,
+            poke_interval=5,
+            timeout=60,
+            exponential_backoff=False)
+
+        started_at = timezone.utcnow() - timedelta(seconds=10)
+        self.assertEqual(sensor._get_next_poke_interval(started_at, 1), sensor.poke_interval)
+        self.assertEqual(sensor._get_next_poke_interval(started_at, 2), sensor.poke_interval)
 
 Review comment:
   `sensor.poke_interval` is an exact value `5`. The test is to make sure that between diff tries, the output is not changing. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services