The specs are testing Connect::Message.with_context. This method is used in Connect search. When you click on one of the messages in a set of search results, you can view that message, with context of the conversation (messages written in that conversation immediately before and after the message you selected).
It looks like the specs are breaking on MySql 8.0 because the messages are being returned in a different order than what's expected.
For example, on ./spec/models/connect/message_spec.rb:249, it expected messages in this order:
id: 1418
id: 1420
id: 1421
id: 1422
id: 1423
id: 1424
But the messages were in this order:
id: 1424
id: 1418
id: 1420
id: 1421
id: 1422
id: 1423
Another thing that seems odd is that the message body is expected to be present on the target messages, but it's not present on (at least) some of these specs. See message id 1418 on the first failing example (line 352 on your gist), and message id 1437 on the second failing example (line 404 on your gist).
The majority of Connect::Message.with_context is ActiveRecord (which I assume would be compatible with MySql 8.0). with_context does use Room.accessible_to_user to verify that the current_user has access to the conversation. So it's possible that Room.accessible_to_user is relevant to how these specs are breaking.