Skip to content
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 "... non-joined user can call /events on world_readable room" flakes #1346

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

squahtx
Copy link
Contributor

@squahtx squahtx commented Mar 30, 2023

The test was flaking because it was sometimes waiting for events to come
down /events after they had already appeared in the stream.

Fixes #1113.

Signed-off-by: Sean Quah [email protected]

The test was flaking because it was sometimes waiting for events to come
down /events after they had already appeared in the stream.

Signed-off-by: Sean Quah <[email protected]>
@squahtx squahtx requested a review from a team as a code owner March 30, 2023 09:25
@squahtx
Copy link
Contributor Author

squahtx commented Mar 30, 2023

Thanks for the review!

@squahtx squahtx merged commit 5727f78 into develop Mar 30, 2023
@squahtx squahtx deleted the squah/fix_history_visibility_flake branch March 30, 2023 12:36
@squahtx
Copy link
Contributor Author

squahtx commented Mar 30, 2023

I forgot to mention that the flake could be reproduced reliably by inserting a delay into await_event_not_history_visibility_or_presence_for.

diff --git a/tests/30rooms/30history-visibility.pl b/tests/30rooms/30history-visibility.pl
index 24d9bea2..ed234b1f 100644
--- a/tests/30rooms/30history-visibility.pl
+++ b/tests/30rooms/30history-visibility.pl
@@ -573,6 +573,7 @@ push our @EXPORT, qw( await_event_not_history_visibility_or_presence_for );
 sub await_event_not_history_visibility_or_presence_for
 {
    my ( $user, $room_id, $allowed_users, %params ) = @_;
+   delay( 1 )->then( sub {
    await_event_for( $user,
       room_id => $room_id,
       filter  => sub {
@@ -590,5 +591,6 @@ sub await_event_not_history_visibility_or_presence_for
    )->on_done( sub {
       my ( $event ) = @_;
       log_if_fail "event", $event
-   });
+   })
+   })
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Real non-joined user can call /events on world_readable room is flaky
2 participants