Skip to content

Commit

Permalink
Deflake guest user test
Browse files Browse the repository at this point in the history
*Hopefully*, fixes #836
  • Loading branch information
richvdh committed May 15, 2020
1 parent 1e86c19 commit da4cdc8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/30rooms/13guestaccess.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit da4cdc8

Please sign in to comment.