deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

`test_markseen_message_and_mdn` failed with "message could not be send, does chat exist?"

Open iequidoo opened this issue 1 year ago • 1 comments

https://github.com/deltachat/deltachat-core-rust/actions/runs/11426571387/job/31789696340

_____________________ test_markseen_message_and_mdn[True] ______________________
[gw2] darwin -- Python 3.10.14 /Users/runner/work/deltachat-core-rust/deltachat-core-rust/python/.tox/py/bin/python

acfactory = <deltachat.testplugin.ACFactory object at 0x00000001593af718>
mvbox_move = True

    @pytest.mark.parametrize("mvbox_move", [True, False])
    def test_markseen_message_and_mdn(acfactory, mvbox_move):
        # Please only change this test if you are very sure that it will still catch the issues it catches now.
        # We had so many problems with markseen, if in doubt, rather create another test, it can't harm.
        ac1 = acfactory.new_online_configuring_account(mvbox_move=mvbox_move)
        ac2 = acfactory.new_online_configuring_account(mvbox_move=mvbox_move)
        acfactory.bring_accounts_online()
        # Do not send BCC to self, we only want to test MDN on ac1.
        ac1.set_config("bcc_self", "0")
    
>       acfactory.get_accepted_chat(ac1, ac2).send_text("hi")

tests/test_1_online.py:802: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Chat id=12 name=ci-c9nmt4@***>, text = 'hi'

    def send_text(self, text):
        """send a text message and return the resulting Message instance.
    
        :param msg: unicode text
        :raises ValueError: if message can not be send/chat does not exist.
        :returns: the resulting :class:`deltachat.message.Message` instance
        """
        msg = as_dc_charpointer(text)
        msg_id = lib.dc_send_text_msg(self.account._dc_context, self.id, msg)
        if msg_id == 0:
>           raise ValueError("message could not be send, does chat exist?")
E           ValueError: message could not be send, does chat exist?

job-logs.txt

iequidoo avatar Oct 20 '24 13:10 iequidoo

I also have seen failures like this in CFFI tests:

         lp.sec("ac2_offl: going online, checking the 'member added' message")
        ac2_offl.start_io()
        # Receive "Member Me (<addr>) added by <addr>." message.
        msg_in = ac2_offl._evtracker.wait_next_incoming_message()
>       contact = msg_in.get_sender_contact()
E       AttributeError: 'NoneType' object has no attribute 'get_sender_contact'

(https://github.com/deltachat/deltachat-core-rust/actions/runs/11441468264/job/31829771100?pr=6084)

         lp.sec("ac2_offl: receiving message")
        ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
        msg_in = ac2_offl.get_message_by_id(ev.data2)
>       assert msg_in.is_system_message()
E       AttributeError: 'NoneType' object has no attribute 'is_system_message'

(https://github.com/deltachat/deltachat-core-rust/actions/runs/11441468264/job/31829771507?pr=6084)

I guess unwrap_or_log_default() logs the error to the event channel, but test finishes before the error is read and logged into pytest output, so actual error is not visible. Could be "database is locked" internally: https://github.com/deltachat/deltachat-core-rust/issues/6066

link2xt avatar Oct 21 '24 14:10 link2xt

Have run the test over 100 times and couldn't reproduce. Though the original failure is reported for macOS and i run on Linux, let's close this and reopen if it happens again.

iequidoo avatar Nov 14 '24 21:11 iequidoo