[ 
https://issues.apache.org/jira/browse/AIRFLOW-2207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16395607#comment-16395607
 ] 

ASF subversion and git services commented on AIRFLOW-2207:
----------------------------------------------------------

Commit 7ab53e6f3d12d36a9828ad6facc25598652b1023 in incubator-airflow's branch 
refs/heads/master from [~sekikn]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=7ab53e6 ]

[AIRFLOW-2207] Fix flaky test that uses app.cached_app()

tests.www.test_views:TestMountPoint.test_mount changes base_url
then calls airflow.www.app.cached_app().
But if another test calls app.cached_app() first without changing
base_url, succeeding test_mount fails on Travis.
So test_mount should clear cached app for itself in its setup method
so as to remount base_url forcefully.


> Fix flaky test that uses app.cached_app()
> -----------------------------------------
>
>                 Key: AIRFLOW-2207
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2207
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: tests
>            Reporter: Kengo Seki
>            Assignee: Kengo Seki
>            Priority: Minor
>             Fix For: 1.10.0
>
>
> tests.www.test_views:TestMountPoint.test_mount changes base_url then calls 
> airflow.www.app.cached_app().
> But if another test calls app.cached_app() first without changing base_url, 
> succeeding test_mount fails on Travis.
> For example, adding the following test causes test_mount to fail,
> whereas test_dummy itself succeeds:
> {code}
> class TestDummy(unittest.TestCase):
>     def setUp(self):
>         super(TestDummy, self).setUp()
>         configuration.load_test_config()
>         app = application.cached_app(testing=True)
>         self.client = Client(app)
>     def test_dummy(self):
>         response, _, _ = self.client.get('/', follow_redirects=True)
>         resp_html = b''.join(response)
>         self.assertIn(b"DAGs", resp_html)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to