diff --git a/tests/30rooms/13guestaccess.pl b/tests/30rooms/13guestaccess.pl index f5480bc35..2ea6dd1b0 100644 --- a/tests/30rooms/13guestaccess.pl +++ b/tests/30rooms/13guestaccess.pl @@ -34,7 +34,11 @@ matrix_set_room_guest_access( $user, $room_id, "can_join" ) ->then( sub { - matrix_join_room( $guest_user, $room_id ) + # we use join_room_synced as a proxy for ensuring that the join event + # has propagated to the workers, otherwise the worker that receives + # the event send request might not know that we are in the room. + # (see https://github.com/matrix-org/sytest/issues/836) + matrix_join_room_synced( $guest_user, $room_id ); })->then( sub { matrix_send_room_text_message( $guest_user, $room_id, body => "sup" ); })->then( sub { @@ -125,7 +129,7 @@ matrix_set_room_guest_access( $user, $room_id, "can_join" ) ->then( sub { - matrix_join_room( $guest_user, $room_id ); + matrix_join_room_synced( $guest_user, $room_id ); })->then( sub { matrix_get_room_membership( $user, $room_id, $guest_user ); })->then( sub { @@ -154,7 +158,11 @@ my $displayname_uri = "/r0/profile/:user_id/displayname"; matrix_set_room_guest_access( $user, $room_id, "can_join" )->then( sub { - matrix_join_room( $guest_user, $room_id ); + # we use join_room_synced as a proxy for ensuring that the join event + # has propagated to the workers, otherwise the worker that receives + # the profile request might not know that we are in the room. + # (see https://github.com/matrix-org/sytest/issues/836) + matrix_join_room_synced( $guest_user, $room_id ); })->then( sub { do_request_json_for( $guest_user, method => "GET", @@ -225,7 +233,7 @@ })->then( sub { matrix_join_room( $remote_user, $room_id ); })->then( sub { - matrix_join_room( $guest_user, $room_id ); + matrix_join_room_synced( $guest_user, $room_id ); })->then( sub { matrix_get_room_membership( $local_user, $room_id, $guest_user ); })->then( sub {