Repository: incubator-airflow Updated Branches: refs/heads/master 92314f33f -> cef01b2a8
[AIRFLOW-1245] Fix random failure in test_trigger_dag_for_date Closes #2325 from skudriashev/airflow-1245 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/cef01b2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/cef01b2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/cef01b2a Branch: refs/heads/master Commit: cef01b2a8636187ab18f99594eecdcf145b84521 Parents: 92314f3 Author: Stanislav Kudriashev <stas.kudrias...@gmail.com> Authored: Mon May 29 17:17:30 2017 +0200 Committer: Bolke de Bruin <bo...@xs4all.nl> Committed: Mon May 29 17:17:30 2017 +0200 ---------------------------------------------------------------------- tests/utils/test_helpers.py | 1 - tests/www/api/experimental/test_endpoints.py | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/cef01b2a/tests/utils/test_helpers.py ---------------------------------------------------------------------- diff --git a/tests/utils/test_helpers.py b/tests/utils/test_helpers.py index 61f88d6..83c519d 100644 --- a/tests/utils/test_helpers.py +++ b/tests/utils/test_helpers.py @@ -67,7 +67,6 @@ class TestHelpers(unittest.TestCase): os.kill(child_pid.value, signal.SIGKILL) # terminate doesnt work here except OSError: pass - child.terminate() def test_kill_using_shell(self): """Test when no process exists.""" http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/cef01b2a/tests/www/api/experimental/test_endpoints.py ---------------------------------------------------------------------- diff --git a/tests/www/api/experimental/test_endpoints.py b/tests/www/api/experimental/test_endpoints.py index 429afe0..dacee32 100644 --- a/tests/www/api/experimental/test_endpoints.py +++ b/tests/www/api/experimental/test_endpoints.py @@ -11,23 +11,30 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import unittest from datetime import datetime, timedelta +import json +import unittest from urllib.parse import quote_plus -from airflow.api.common.experimental.trigger_dag import trigger_dag -from airflow.models import DagBag -import json +from airflow import configuration +from airflow.api.common.experimental.trigger_dag import trigger_dag +from airflow.models import DagBag, DagRun, TaskInstance +from airflow.settings import Session +from airflow.www import app as application class ApiExperimentalTests(unittest.TestCase): + def setUp(self): - from airflow import configuration configuration.load_test_config() - from airflow.www import app as application app = application.create_app(testing=True) self.app = app.test_client() + session = Session() + session.query(DagRun).delete() + session.query(TaskInstance).delete() + session.commit() + session.close() def test_task_info(self): url_template = '/api/experimental/dags/{}/tasks/{}'