tests/test_conversation_api.py::TestConversationApi::test_sent_is_every_thread_written_in_not_the_last_word failed once and passed on the next run of the same commit, and 19.0 passed on the same machine in between. Not caused by the change it showed up under.
AssertionError: 'Offerte' != 'Re: Offerte'
: the row is the conversation, not the mail we sent
The test creates both messages through _mail(), which passes no date, so Odoo stamps both with now() truncated to the second. When they land in the same second the two rows share a date, and _newest_per_group then picks whichever the query returned last -- so which message becomes the row is undefined, and the assertion holds or does not by timing.
tools/ui_preview.sh already learned this ("a seed that lets Postgres stamp everything now() opens on whichever record sorts first when the seed happens to straddle a second"); the fix here is the same one: give the two messages explicit dates a minute apart, so the newest is the newest by construction. Worth checking the other tests in that file that build a thread through _mail() without dates.
tests/test_conversation_api.py::TestConversationApi::test_sent_is_every_thread_written_in_not_the_last_wordfailed once and passed on the next run of the same commit, and 19.0 passed on the same machine in between. Not caused by the change it showed up under.The test creates both messages through
_mail(), which passes nodate, so Odoo stamps both withnow()truncated to the second. When they land in the same second the two rows share adate, and_newest_per_groupthen picks whichever the query returned last -- so which message becomes the row is undefined, and the assertion holds or does not by timing.tools/ui_preview.shalready learned this ("a seed that lets Postgres stamp everythingnow()opens on whichever record sorts first when the seed happens to straddle a second"); the fix here is the same one: give the two messages explicit dates a minute apart, so the newest is the newest by construction. Worth checking the other tests in that file that build a thread through_mail()without dates.