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_markseen_message_and_mdn failed with "message could not be send, does chat exist?" #6078

Closed
iequidoo opened this issue Oct 20, 2024 · 2 comments
Labels
bug Something is not working

Comments

@iequidoo
Copy link
Collaborator

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 iequidoo added the bug Something is not working label Oct 20, 2024
@link2xt
Copy link
Collaborator

link2xt commented Oct 21, 2024

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: #6066

@iequidoo
Copy link
Collaborator Author

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 iequidoo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants