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

[Tests] ERROR at setup of test_cancel #7126

Closed
drew2a opened this issue Oct 31, 2022 · 0 comments · Fixed by #7127
Closed

[Tests] ERROR at setup of test_cancel #7126

drew2a opened this issue Oct 31, 2022 · 0 comments · Fixed by #7127

Comments

@drew2a
Copy link
Contributor

drew2a commented Oct 31, 2022

This error occurred https://github.com/Tribler/tribler/actions/runs/3361258378/jobs/5571841665 in #7112

==================================== ERRORS ====================================
    res = self._callback(*self._args, **self._kwargs)
  File "/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/multiprocessing/util.py", line 464, in close_fds
    os.close(fd)
OSError: [Errno 9] Bad file descriptor
________________________ ERROR at setup of test_cancel _________________________

fixturedef = <FixtureDef argname='event_loop' scope='function' baseid='src/tribler/core'>
request = <SubRequest 'event_loop' for <Function test_cancel>>

    @pytest.hookimpl(hookwrapper=True)
    def pytest_fixture_setup(
        fixturedef: FixtureDef, request: SubRequest
    ) -> Optional[object]:
        """Adjust the event loop policy when an event loop is produced."""
        if fixturedef.argname == "event_loop":
            outcome = yield
            loop = outcome.get_result()
            policy = asyncio.get_event_loop_policy()
            try:
                old_loop = policy.get_event_loop()
                if old_loop is not loop:
>                   old_loop.close()

../../../.virtualenvs/.venv/lib/python3.8/site-packages/pytest_asyncio/plugin.py:382: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/unix_events.py:58: in close
    super().close()
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/selector_events.py:92: in close
    self._close_self_pipe()
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/selector_events.py:102: in _close_self_pipe
    self._csock.close()
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/socket.py:500: in close
    self._real_close()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <socket.socket [closed] fd=-1, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
_ss = <class '_socket.socket'>

    def _real_close(self, _ss=_socket.socket):
        # This function should not reference any globals. See issue #808164.
>       _ss.close(self)
E       OSError: [Errno 9] Bad file descriptor

/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/socket.py:494: OSError
_______________________ ERROR at teardown of test_cancel _______________________

fixturedef = <FixtureDef argname='event_loop' scope='function' baseid='src/tribler/core'>
request = <SubRequest 'event_loop' for <Function test_cancel>>

    @pytest.hookimpl(trylast=True)
    def pytest_fixture_post_finalizer(fixturedef: FixtureDef, request: SubRequest) -> None:
        """Called after fixture teardown"""
        if fixturedef.argname == "event_loop":
            policy = asyncio.get_event_loop_policy()
            try:
                loop = policy.get_event_loop()
            except RuntimeError:
                loop = None
            if loop is not None:
                # Clean up existing loop to avoid ResourceWarnings
>               loop.close()

../../../.virtualenvs/.venv/lib/python3.8/site-packages/pytest_asyncio/plugin.py:364: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/unix_events.py:58: in close
    super().close()
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/selector_events.py:92: in close
    self._close_self_pipe()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_UnixSelectorEventLoop running=False closed=False debug=False>

    def _close_self_pipe(self):
>       self._remove_reader(self._ssock.fileno())
E       AttributeError: 'NoneType' object has no attribute 'fileno'

/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/asyncio/selector_events.py:99: AttributeError
=========================== short test summary info ============================
ERROR src/tribler/core/utilities/tests/test_async_group.py::test_cancel - OSE...
ERROR src/tribler/core/utilities/tests/test_async_group.py::test_cancel - Att...
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 2 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
@drew2a drew2a added this to the 7.13.0 milestone Oct 31, 2022
@drew2a drew2a self-assigned this Oct 31, 2022
This was referenced Oct 31, 2022
@drew2a drew2a removed this from the 7.13.0 milestone Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant