-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flakey sytest 80jira/syn606 #421
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
|
||
test( | ||
"$name user can call /events on another world_readable room (SYN-606)", | ||
requires => [ $fixture->( with_events => 0 ), | ||
local_user_fixture( with_events => 0 ) ], | ||
requires => [ $fixture->(), local_user_fixture() ], | ||
|
||
do => sub { | ||
my ( $nonjoined_user, $user ) = @_; | ||
|
@@ -27,20 +26,28 @@ | |
})->then( sub { | ||
matrix_initialsync_room( $nonjoined_user, $room_id1 ) | ||
})->then( sub { | ||
my ( $body ) = @_; | ||
|
||
my $from_token = $body->{messages}{end}; | ||
|
||
Future->needs_all( | ||
matrix_send_room_text_message( $user, $room_id1, body => "moose" ), | ||
await_event_not_history_visibility_or_presence_for( $nonjoined_user, $room_id1, [] ), | ||
await_event_not_history_visibility_or_presence_for( $nonjoined_user, $room_id1, [], | ||
from => $from_token, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no explanation anywhere (PR, commit comment, a comment in code) as to what is going on here or why it is a good thing. Am I supposed to read your mind? generally passing an explicit If this is the right thing to e doing for some reason, please could you add a comment explaining why. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I've updated with a comment. |
||
), | ||
); | ||
})->then( sub { | ||
matrix_initialsync_room( $nonjoined_user, $room_id2 ) | ||
})->then( sub { | ||
Future->needs_all( | ||
delay( 0.1 )->then( sub { | ||
matrix_send_room_text_message( $user, $room_id2, body => "mice" ); | ||
}), | ||
my ( $body ) = @_; | ||
|
||
my $from_token = $body->{messages}{end}; | ||
|
||
await_event_not_history_visibility_or_presence_for( $nonjoined_user, $room_id2, [] ) | ||
->then( sub { | ||
Future->needs_all( | ||
matrix_send_room_text_message( $user, $room_id2, body => "mice" ), | ||
await_event_not_history_visibility_or_presence_for( $nonjoined_user, $room_id2, [], | ||
from => $from_token, | ||
)->then( sub { | ||
my ( $event ) = @_; | ||
|
||
assert_json_keys( $event, qw( content ) ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you've moved
%params
from the start of the arg list to the end inGET_new_events_for
: let's be consistent and put it at the end.