Merge pull request #4656 from stapelberg/flaky

Fix flaky tests: sync after kill
This commit is contained in:
Orestis Floros 2021-11-07 13:51:55 +01:00 committed by GitHub
commit 43e805a00d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -972,6 +972,8 @@ sub kill_all_windows {
# Sync in case not all windows are managed by i3 just yet.
sync_with_i3;
cmd '[title=".*"] kill';
# Sync to make sure x_window_kill() calls have taken effect.
sync_with_i3;
}
=head2 events_for($subscribecb, [ $rettype ], [ $eventcbs ])

View File

@ -56,7 +56,11 @@ sub kill_subtest {
my $focus = AnyEvent->condvar;
my @events = events_for(
sub { cmd $cmd },
sub {
cmd $cmd;
# Sync to make sure x_window_kill() calls have taken effect.
sync_with_i3;
},
'window');
is(scalar @events, 1, 'Received 1 event');