You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/27 13:03:36 UTC

[GitHub] [airflow] Taragolis opened a new pull request, #28606: Disable flaky plugin in pytest addopts config

Taragolis opened a new pull request, #28606:
URL: https://github.com/apache/airflow/pull/28606

   After #28562 PR Tests steps failed with error
   
   ```console
   __________ ERROR at setup of TestSSHHook.test_exec_ssh_client_command __________
   
   self = <flaky.flaky_pytest_plugin.FlakyPlugin object at 0x7fac59336b90>
   item = <Function test_exec_ssh_client_command>
   
       def pytest_runtest_setup(self, item):
           """
           Pytest hook to modify the test before it's run.
       
           :param item:
               The test item.
           """
           if not self._has_flaky_attributes(item):
               if hasattr(item, 'iter_markers'):
                   for marker in item.iter_markers(name='flaky'):
   >                   self._make_test_flaky(item, *marker.args, **marker.kwargs)
   E                   TypeError: _make_test_flaky() got an unexpected keyword argument 'reruns'
   
   /usr/local/lib/python3.7/site-packages/flaky/flaky_pytest_plugin.py:244: TypeError
   ```
   
   Seems like somewhere `flaky` still persist (docker cache?) but not affects main. This PR disable this plugin in `pytest` config which also useful if this plugin will distributed as some package dependency.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057677601


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   Should we explicitly depend on `pytest-rerunfailures`?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
Taragolis commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057742874


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   Ohhh... we use same config for breeze tests
   
   ```console
   Run python -m pytest ./dev/breeze/ -n auto --color=yes
   ERROR: Missing required plugins: pytest-rerunfailures
   
   Error: Process completed with exit code 4.
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
Taragolis commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057738209


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   ```console
   ========================================================= test session starts =========================================================
   platform linux -- Python 3.7.16, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/local/bin/python
   cachedir: .pytest_cache
   rootdir: /opt/airflow, configfile: pytest.ini
   plugins: cov-4.0.0, asyncio-0.20.3, rerunfailures-9.1.1, instafail-0.4.2, anyio-3.6.2, timeouts-1.2.1, xdist-3.1.0, requests-mock-1.10.0, capture-warnings-0.0.4, httpx-0.21.2, time-machine-2.8.2
   ```
   
   THis work without **required_plugins** but no problem add this



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
Taragolis commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057690939


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   Yeah, out dev dependencies already depend on `pytest-rerunfailures`
   
   https://github.com/apache/airflow/blob/4e545c6e54712eedb6ca9cbb8333393ae3f6cba2/setup.py#L402-L404
   
   I do not know how we use this plugin before - it just sits in our dev-requirements, the same with `flaky` it is only used for couple tests, which can replaced by `pytest-rerunfailures`
   
   There is maybe another good question: should we explicitly specify all plugins which we actually use? But this only help to fail fast if plugin not installed 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis merged pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
Taragolis merged PR #28606:
URL: https://github.com/apache/airflow/pull/28606


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057707354


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   If that works no issues, was just wondering if it's possible to add
   ```
   required_plugins = 
       pytest-rerunfailures
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
Taragolis commented on code in PR #28606:
URL: https://github.com/apache/airflow/pull/28606#discussion_r1057690939


##########
pytest.ini:
##########
@@ -19,8 +19,8 @@
 addopts =
     -rasl
     --verbosity=2
-;    This will treat all tests as flaky
-;    --force-flaky
+    ; Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker.
+    -p no:flaky

Review Comment:
   Yeah, out dev dependencies already depend on `pytest-rerunfailures`
   
   https://github.com/apache/airflow/blob/4e545c6e54712eedb6ca9cbb8333393ae3f6cba2/setup.py#L402-L404
   
   I do not know how we use this plugin before - it just sits in our dev-requirements, the same with `flaky` it is only used for couple tests, which can replaced by `pytest-rerunfailures`
   
   There is maybe another good question: should we specify explicitly specify all plugins which we actually use? But this only help to fail fast if plugin not installed 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #28606: Disable `flaky` plugin in pytest addopts config

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #28606:
URL: https://github.com/apache/airflow/pull/28606#issuecomment-1366021979

   Nice.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org