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

test_broadcast fails on Fedora 41 #585

Closed
cryptomilk opened this issue Jan 3, 2025 · 4 comments
Closed

test_broadcast fails on Fedora 41 #585

cryptomilk opened this issue Jan 3, 2025 · 4 comments

Comments

@cryptomilk
Copy link
Contributor

I wanted to package version 0.5.2 for Fedora, but test_broadcast fails. Help to debug that would be appreciated.

______________________________________ test_broadcast ___________________________________
                                                                                                                                                                                              
vim = <pynvim.api.nvim.Nvim object at 0x7f0488a73350>                                                                                                                                         
                                                                                                                                                                                              
    def test_broadcast(vim: Nvim) -> None:                                                                                                                                                    
        vim.command('call rpcnotify(0, "event1", 1, 2, 3)')                                                                                                                                   
        vim.command('call rpcnotify(0, "event2", 4, 5, 6)')                                                                                                                                   
        vim.command('call rpcnotify(0, "event2", 7, 8, 9)')                                                                                                                                   
>       event = vim.next_message()                                                                                                                                                            
                                                                                                                                                                                              
test/test_events.py:43:                                                                                                                                                                       
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pynvim/api/nvim.py:220: in next_message                                                                                                                                                       
    msg = self._session.next_message()                                                         
pynvim/msgpack_rpc/session.py:99: in next_message                                              
    self._async_session.run(self._enqueue_request_and_stop,                                    
pynvim/msgpack_rpc/async_session.py:73: in run                                                 
    self._msgpack_stream.run(self._on_message)                                                 
pynvim/msgpack_rpc/msgpack_stream.py:43: in run                                                
    self.loop.run(self._on_data)                                                               
pynvim/msgpack_rpc/event_loop/base.py:190: in run                                              
    self._run()                                                                                
pynvim/msgpack_rpc/event_loop/asyncio.py:259: in _run                                          
    self._loop.run_forever()                                                                   
/usr/lib64/python3.12/asyncio/base_events.py:640: in run_forever                               
    self._run_once()                                                                           
/usr/lib64/python3.12/asyncio/base_events.py:1954: in _run_once                                
    event_list = self._selector.select(timeout)
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
                                               
self = <selectors.EpollSelector object at 0x7f0488a735c0>, timeout = -1                                                                                                                       
                                                                                               
    def select(self, timeout=None):                                                            
        if timeout is None:                                                                                                                                                                   
            timeout = -1                                                                                                                                                                      
        elif timeout <= 0:                                                                                                                                                                    
            timeout = 0                                                                                                                                                                       
        else:                                                                                                                                                                                 
            # epoll_wait() has a resolution of 1 millisecond, round away                                                                                                                      
            # from zero to wait *at least* timeout seconds.                                    
            timeout = math.ceil(timeout * 1e3) * 1e-3                                                                                                                                         
     
        # epoll_wait() expects `maxevents` to be greater than zero;
        # we want to make sure that `select()` can be called when no
        # FD is registered.
        max_ev = max(len(self._fd_to_key), 1)
     
        ready = []
        try:
>           fd_event_list = self._selector.poll(timeout, max_ev)
E           Failed: Timeout >5.0s

/usr/lib64/python3.12/selectors.py:468: Failed
====================================short test summary info =====================================
FAILED test/test_events.py::test_broadcast - Failed: Timeout >5.0s

@justinmk
Copy link
Member

justinmk commented Jan 3, 2025

#570 might provide some context, but I don't see how it can cause this test failure. Maybe it's related to asyncio somehow...

@wookayin
Copy link
Member

wookayin commented Jan 5, 2025

I can see this fails on my local macOS environment with specific versions of nvim:

  • nvim-0.11 nightly (HEAD as of today): passes
  • nvim-0.9.x and nvim-0.10.x: fails (timeout) with the exactly same reason

Prior to #570, this might have been different due to some behavior difference. Since pynvim CI is not run with nvim-stable (we should do so!), this bug hadn't been being detected.

@justinmk
Copy link
Member

justinmk commented Jan 5, 2025

Thanks for noting that! We should just skip test_broadcast on older Nvim versions. nvim_subscribe was never used much at all.

wookayin added a commit to wookayin/pynvim that referenced this issue Jan 7, 2025
The fix made in neovim#570 actually works for Nvim 0.11+, depending on the
behavior change neovim/neovim#28487.

We should just skip test_broadcast on older Nvim versions (see neovim#585).
@wookayin wookayin removed the asyncio label Jan 7, 2025
@wookayin
Copy link
Member

wookayin commented Jan 7, 2025

This should be fixed by c3fe993. Please let us know if the error still happens.

@wookayin wookayin closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants