From 034199da24c60014751503a059fe1ea7ac757381 Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Wed, 15 Apr 2020 03:00:52 +0800 Subject: [PATCH] Make message history pagination test less flaky (#851) * Make message history pagination test less flaky * Use await_sync_timeline_contains --- tests/30rooms/04messages.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/30rooms/04messages.pl b/tests/30rooms/04messages.pl index 9a267a515..2eac89727 100644 --- a/tests/30rooms/04messages.pl +++ b/tests/30rooms/04messages.pl @@ -215,6 +215,15 @@ body => "Message number $_[0]" ) } foreach => [ 1 .. 20 ] )->then( sub { + await_sync_timeline_contains( + $user, $room_id, check => sub { + any { + $_->{type} eq "m.room.message" + && $_->{content}{body} eq "Message number 20" + } @_; + }, + ); + })->then( sub { matrix_get_room_messages( $user, $room_id, limit => 5 ) })->then( sub { my ( $body ) = @_;