potiuk commented on a change in pull request #18531:
URL: https://github.com/apache/airflow/pull/18531#discussion_r716678182



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -2658,9 +2659,14 @@ def test_do_schedule_max_active_runs_dag_timed_out(self, 
dag_maker):
         assert run1_ti.state == State.SKIPPED
 
         # Run scheduling again to assert run2 has started
-        self.scheduler_job._do_scheduling(session)
-        run2 = session.merge(run2)
-        session.refresh(run2)
+        for i in range(1, 10):
+            self.scheduler_job._do_scheduling(session)
+            run2 = session.merge(run2)
+            session.refresh(run2)
+            if run2.state == State.QUEUED:
+                sleep(0.1)
+                continue
+            break

Review comment:
       Ah coll. Good points. I will take a look a bit closer soon and see it. I 
would love to learn a bit more on how those tests are working :D

##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -2658,9 +2659,14 @@ def test_do_schedule_max_active_runs_dag_timed_out(self, 
dag_maker):
         assert run1_ti.state == State.SKIPPED
 
         # Run scheduling again to assert run2 has started
-        self.scheduler_job._do_scheduling(session)
-        run2 = session.merge(run2)
-        session.refresh(run2)
+        for i in range(1, 10):
+            self.scheduler_job._do_scheduling(session)
+            run2 = session.merge(run2)
+            session.refresh(run2)
+            if run2.state == State.QUEUED:
+                sleep(0.1)
+                continue
+            break

Review comment:
       Ah cool. Good points. I will take a look a bit closer soon and see it. I 
would love to learn a bit more on how those tests are working :D




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