deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
664 stars 85 forks source link

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

Open iequidoo opened 4 days ago

iequidoo commented 4 days ago

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

link2xt commented 3 days ago

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 as locked" internally: https://github.com/deltachat/deltachat-core-rust/issues/6066