From 281a76cd64dcf46e953694dbd6aedf6e26679f07 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Tue, 26 Nov 2019 10:27:46 +0000 Subject: [PATCH] Fix a flaky cross-signing test (#749) The basic problem in this test is that there are three things that can cause a "devices/changed" sync update: * inviting the user * the user joining * the user doing his cross-signing ... and it's hard to be sure that we're getting the right update. If we make sure that we wait for each update, it fixes the race condition. --- tests/41end-to-end-keys/08-cross-signing.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/41end-to-end-keys/08-cross-signing.pl b/tests/41end-to-end-keys/08-cross-signing.pl index f354f33df..d19f1bba8 100644 --- a/tests/41end-to-end-keys/08-cross-signing.pl +++ b/tests/41end-to-end-keys/08-cross-signing.pl @@ -525,10 +525,11 @@ matrix_create_room( $user1 ); })->then( sub { ( $room_id ) = @_; - + matrix_sync( $user1 ); + })->then( sub { matrix_invite_user_to_room( $user1, $user2, $room_id ) })->then( sub { - matrix_sync( $user1 ); + sync_until_user_in_device_list( $user1, $user2 ); })->then( sub { matrix_join_room( $user2, $room_id ); })->then( sub {