jedcunningham commented on code in PR #39351:
URL: https://github.com/apache/airflow/pull/39351#discussion_r1586519165


##########
tests/sensors/test_base.py:
##########
@@ -284,62 +284,59 @@ def test_ok_with_reschedule(self, make_sensor, 
time_machine, task_reschedules_fo
             if ti.task_id == DUMMY_OP:
                 assert ti.state == State.NONE
 
-    def test_fail_with_reschedule(self, make_sensor, time_machine):
+    def test_fail_with_reschedule(self, make_sensor, time_machine, session):
         sensor, dr = make_sensor(return_value=False, poke_interval=10, 
timeout=5, mode="reschedule")
 
+        def _get_tis():
+            tis = dr.get_task_instances(session=session)
+            yield next(x for x in tis if x.task_id == SENSOR_OP)
+            yield next(x for x in tis if x.task_id == DUMMY_OP)
+
         # first poke returns False and task is re-scheduled
         date1 = timezone.utcnow()
         time_machine.move_to(date1, tick=False)
-        self._run(sensor)
-        tis = dr.get_task_instances()
-        assert len(tis) == 2

Review Comment:
   It might be worth keeping this around to make sure we don't get more than 2. 
Maybe `_get_tis()` can become `_split_tis(ti)` or something?



-- 
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