airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-813] Fix unterminated scheduler unit tests
Date Fri, 27 Jan 2017 20:03:48 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/v1-8-test bf8981095 -> b8a1108a0


[AIRFLOW-813] Fix unterminated scheduler unit tests

Closes #2028 from fenglu-g/master

(cherry picked from commit cf6d50c0e3d59ec9155be445c127c90a05cc90a2)
Signed-off-by: Bolke de Bruin <bolke@xs4all.nl>


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/b8a1108a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/b8a1108a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/b8a1108a

Branch: refs/heads/v1-8-test
Commit: b8a1108a031a6df393c4693953a61c8c21112d9c
Parents: bf89810
Author: Feng Lu <fenglu@fengcloud.hot.corp.google.com>
Authored: Fri Jan 27 21:03:15 2017 +0100
Committer: Bolke de Bruin <bolke@xs4all.nl>
Committed: Fri Jan 27 21:03:42 2017 +0100

----------------------------------------------------------------------
 tests/jobs.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/b8a1108a/tests/jobs.py
----------------------------------------------------------------------
diff --git a/tests/jobs.py b/tests/jobs.py
index b674bcd..1872266 100644
--- a/tests/jobs.py
+++ b/tests/jobs.py
@@ -267,7 +267,8 @@ class SchedulerJobTest(unittest.TestCase):
         Utility function that runs a single scheduler loop without actually
         changing/scheduling any dags. This is useful to simulate the other side effects of
         running a scheduler loop, e.g. to see what parse errors there are in the
-        dags_folder.
+        dags_folder. The run_duration is limited to 20 seconds as the scheduler
+        will run forever as num_runs is ignored when there is no dag file.
 
         :param dags_folder: the directory to traverse
         :type directory: str
@@ -275,7 +276,8 @@ class SchedulerJobTest(unittest.TestCase):
         scheduler = SchedulerJob(
             dag_id='this_dag_doesnt_exist',  # We don't want to actually run anything
             num_runs=1,
-            subdir=os.path.join(dags_folder))
+            subdir=os.path.join(dags_folder),
+            run_duration=20)
         scheduler.heartrate = 0
         scheduler.run()
 


Mime
View raw message