Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Ignore exception in thread warning from pytest>=6.2 #11167

Merged
merged 3 commits into from Dec 15, 2020

Conversation

pllim
Copy link
Member

@pllim pllim commented Dec 14, 2020

Description

This pull request is a stop-gap fix for two SAMP test failures that started appearing around the time pytest 6.2.0 was released (about 2 days ago). We should not pin ignore this forever but I am not sure how to fix this error:

________________ ERROR at teardown of TestWebProfile.test_main _________________

cls = <class '_pytest.runner.CallInfo'>
func = <function call_runtest_hook.<locals>.<lambda> at 0x7fda56d37d30>
when = 'teardown'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

>   ???

_pytest/runner.py:311: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_pytest/runner.py:255: in <lambda>
    ???
pluggy/hooks.py:286: in __call__
    ???
pluggy/manager.py:93: in _hookexec
    ???
pluggy/manager.py:84: in <lambda>
    ???
_pytest/threadexception.py:90: in pytest_runtest_teardown
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-141
E   
E   Traceback (most recent call last):
E     File "astropy/samp/utils.py", line 62, in __call__
E     File "xmlrpc/client.py", line 1109, in __call__
E     File "xmlrpc/client.py", line 1450, in __request
E     File "xmlrpc/client.py", line 1153, in request
E     File "xmlrpc/client.py", line 1169, in single_request
E     File "xmlrpc/client.py", line 1341, in parse_response
E     File "xmlrpc/client.py", line 655, in close
E   xmlrpc.client.Fault: <Fault 1: '<class \'Exception\'>:method "server_close" is not supported'>
E   
E   During handling of the above exception, another exception occurred:
E   
E   Traceback (most recent call last):
E     File "threading.py", line 932, in _bootstrap_inner
E     File "threading.py", line 870, in run
E     File "/home/runner/work/astropy/astropy/.pyinstaller/astropy_tests/samp/tests/web_profile_test_helpers.py", line 175, in _serve_forever
E       self.hub.server_close()
E     File "astropy/samp/hub_proxy.py", line 96, in server_close
E     File "astropy/samp/utils.py", line 64, in __call__
E   astropy.samp.errors.SAMPProxyError: <SAMPProxyError 1: '<class \'Exception\'>:method "server_close" is not supported'>

_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning
---------------------------- Captured stdout setup -----------------------------
INFO: Hub set to run with Web Profile support enabled. [astropy.samp.hub]
INFO: Hub started [astropy.samp.hub]
------------------------------ Captured log setup ------------------------------
INFO     astropy:hub.py:268 Hub set to run with Web Profile support enabled.
INFO     astropy:hub.py:402 Hub started
--------------------------- Captured stdout teardown ---------------------------
INFO: Hub is stopping... [astropy.samp.hub]
INFO: Hub stopped. [astropy.samp.hub]
---------------------------- Captured log teardown -----------------------------
INFO     astropy:hub.py:471 Hub is stopping...
INFO     astropy:hub.py:497 Hub stopped.
_____________ ERROR at teardown of TestWebProfile.test_web_profile _____________

cls = <class '_pytest.runner.CallInfo'>
func = <function call_runtest_hook.<locals>.<lambda> at 0x7fda75703040>
when = 'teardown'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

>   ???

_pytest/runner.py:311: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_pytest/runner.py:255: in <lambda>
    ???
pluggy/hooks.py:286: in __call__
    ???
pluggy/manager.py:93: in _hookexec
    ???
pluggy/manager.py:84: in <lambda>
    ???
_pytest/threadexception.py:90: in pytest_runtest_teardown
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-264
E   
E   Traceback (most recent call last):
E     File "astropy/samp/utils.py", line 62, in __call__
E     File "xmlrpc/client.py", line 1109, in __call__
E     File "xmlrpc/client.py", line 1450, in __request
E     File "xmlrpc/client.py", line 1153, in request
E     File "xmlrpc/client.py", line 1169, in single_request
E     File "xmlrpc/client.py", line 1341, in parse_response
E     File "xmlrpc/client.py", line 655, in close
E   xmlrpc.client.Fault: <Fault 1: '<class \'Exception\'>:method "server_close" is not supported'>
E   
E   During handling of the above exception, another exception occurred:
E   
E   Traceback (most recent call last):
E     File "threading.py", line 932, in _bootstrap_inner
E     File "threading.py", line 870, in run
E     File "/home/runner/work/astropy/astropy/.pyinstaller/astropy_tests/samp/tests/web_profile_test_helpers.py", line 175, in _serve_forever
E       self.hub.server_close()
E     File "astropy/samp/hub_proxy.py", line 96, in server_close
E     File "astropy/samp/utils.py", line 64, in __call__
E   astropy.samp.errors.SAMPProxyError: <SAMPProxyError 1: '<class \'Exception\'>:method "server_close" is not supported'>

_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning
---------------------------- Captured stdout setup -----------------------------
INFO: Hub set to run with Web Profile support enabled. [astropy.samp.hub]
INFO: Hub started [astropy.samp.hub]
------------------------------ Captured log setup ------------------------------
INFO     astropy:hub.py:268 Hub set to run with Web Profile support enabled.
INFO     astropy:hub.py:402 Hub started
--------------------------- Captured stdout teardown ---------------------------
INFO: Hub is stopping... [astropy.samp.hub]
INFO: Hub stopped. [astropy.samp.hub]
---------------------------- Captured log teardown -----------------------------
INFO     astropy:hub.py:471 Hub is stopping...
INFO     astropy:hub.py:497 Hub stopped.
=========================== short test summary info ============================
ERROR astropy_tests/samp/tests/test_web_profile.py::TestWebProfile::test_main
ERROR astropy_tests/samp/tests/test_web_profile.py::TestWebProfile::test_web_profile
= 13777 passed, 1000 skipped, 234 deselected, 104 xfailed, 2 errors in 343.12s (0:05:43) =

This failure is currently blocking unrelated PRs from running CI to completion.

@pllim
Copy link
Member Author

pllim commented Dec 14, 2020

Hmm... Maybe this is a result of one of their "features," as follows:

pytest-dev/pytest#5299: pytest now warns about unraisable exceptions and unhandled thread exceptions that occur in tests on Python>=3.8. See unraisable for more information.

@pllim pllim changed the title TST: Pin pytest<6.2 due to samp failures TST: Ignore exception in thread warning from pytest>=6.2 Dec 14, 2020
@pllim pllim modified the milestones: v4.3, v4.0.5 Dec 14, 2020
@pllim pllim added the 🔥 Critical label Dec 14, 2020
@pllim
Copy link
Member Author

pllim commented Dec 14, 2020

Remote data failure is unrelated.

@mwcraig mwcraig marked this pull request as ready for review December 15, 2020 19:23
@pllim pllim merged commit eb2b265 into astropy:master Dec 15, 2020
@pllim pllim deleted the tst-pin-pytest-samp-fault branch December 15, 2020 19:29
@embray
Copy link
Member

embray commented Mar 15, 2021

I ran into this failure too on the 4.0.x branch, so this should probably be backported. Though I might investigate whether there is a more fundamental fix.

astrofrog pushed a commit that referenced this pull request Mar 16, 2021
TST: Ignore exception in thread warning from pytest>=6.2
eteq pushed a commit that referenced this pull request Mar 24, 2021
TST: Ignore exception in thread warning from pytest>=6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants