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/test_fd_passing.py::test_sending_file_descriptor_low_level AssertionError: assert ['The name :1...ervice files'] == ['got it'] #161

Open
ncopa opened this issue Mar 29, 2024 · 0 comments

Comments

@ncopa
Copy link

ncopa commented Mar 29, 2024

Test fails with python 3.12:

================================================================ FAILURES ================================================================
_________________________________________________ test_sending_file_descriptor_low_level _________________________________________________
                                                                     
    @pytest.mark.asyncio                                             
    async def test_sending_file_descriptor_low_level():
        bus1 = await MessageBus(negotiate_unix_fd=True).connect()
        bus2 = await MessageBus(negotiate_unix_fd=True).connect()
                                                                     
        fd_before = open_file()                                      
        fd_after = None                                              
                                                                     
        msg = Message(destination=bus1.unique_name,
                      path='/org/test/path',
                      interface='org.test.iface',
                      member='SomeMember',
                      body=[0],
                      signature='h',                                 
                      unix_fds=[fd_before])                                                                                               
                                                                     
        def message_handler(sent): 
            nonlocal fd_after
            if sent.sender == bus2.unique_name and sent.serial == msg.serial:
                assert sent.path == msg.path
                assert sent.serial == msg.serial
                assert sent.interface == msg.interface
                assert sent.member == msg.member
                assert sent.body == [0]
                assert len(sent.unix_fds) == 1
                fd_after = sent.unix_fds[0]
                bus1.send(Message.new_method_return(sent, 's', ['got it']))
                bus1.remove_message_handler(message_handler)
                return True
     
        bus1.add_message_handler(message_handler)
     
        reply = await bus2.call(msg)
>       assert reply.body == ['got it']
E       AssertionError: assert ['The name :1...ervice files'] == ['got it']
E         
E         At index 0 diff: 'The name :1.46 was not provided by any .service files' != 'got it'
E         Use -v to get more diff

test/test_fd_passing.py:103: AssertionError
----------------------------------------------------------- Captured log call ------------------------------------------------------------
ERROR    asyncio:base_events.py:1819 Future exception was never retrieved
future: <Future finished exception=OSError(9, 'Bad file descriptor')> 
Traceback (most recent call last): 
  File "/home/ncopa/aports/community/py3-dbus-next/src/python-dbus-next-0.2.3/test/test_disconnect.py", line 56, in test_unexpected_discon
nect
    await bus.wait_for_disconnect()
  File "/home/ncopa/aports/community/py3-dbus-next/src/python-dbus-next-0.2.3/dbus_next/aio/message_bus.py", line 342, in wait_for_disconn
ect
    return await self._disconnect_future
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ncopa/aports/community/py3-dbus-next/src/python-dbus-next-0.2.3/dbus_next/aio/message_bus.py", line 63, in write_callback
    self.offset += self.sock.send(self.buf[self.offset:])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor
======================================================== short test summary info =========================================================
FAILED test/test_fd_passing.py::test_sending_file_descriptor_low_level - AssertionError: assert ['The name :1...ervice files'] == ['got it
']
========================================= 1 failed, 73 passed, 7 skipped, 1 deselected in 0.32s ==========================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant