From: Michael Stapelberg Date: Wed, 9 Mar 2011 17:47:00 +0000 (+0100) Subject: tests: fix t/19-match.t, needs a delay for i3 to pick up the UnmapNotify event X-Git-Tag: tree-pr3~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=57e7cc8f6aaa402460329c18eaee70f8ccea5145;p=i3%2Fi3 tests: fix t/19-match.t, needs a delay for i3 to pick up the UnmapNotify event --- diff --git a/testcases/t/19-match.t b/testcases/t/19-match.t index 727109a0..bfeda815 100644 --- a/testcases/t/19-match.t +++ b/testcases/t/19-match.t @@ -46,9 +46,14 @@ $content = get_ws_content($tmp); ok(@{$content} == 1, 'window still there'); # now kill the window +cmd 'nop now killing the window'; my $id = $win->{id}; $i3->command(qq|[con_id="$id"] kill|)->recv; +# give i3 some time to pick up the UnmapNotify event +sleep 0.25; + +cmd 'nop checking if its gone'; $content = get_ws_content($tmp); ok(@{$content} == 0, 'window killed'); diff --git a/testcases/t/lib/i3test.pm b/testcases/t/lib/i3test.pm index 87a34981..2251e25f 100644 --- a/testcases/t/lib/i3test.pm +++ b/testcases/t/lib/i3test.pm @@ -32,6 +32,7 @@ use Test::More" . (@_ > 0 ? " qw(@_)" : "") . "; use Test::Exception; use Data::Dumper; use AnyEvent::I3; +use Time::HiRes qw(sleep); use Test::Deep qw(eq_deeply cmp_deeply cmp_set cmp_bag cmp_methods useclass noclass set bag subbagof superbagof subsetof supersetof superhashof subhashof bool str arraylength Isa ignore methods regexprefonly regexpmatches num regexponly scalref reftype hashkeysonly blessed array re hash regexpref hash_each shallow array_each code arrayelementsonly arraylengthonly scalarrefonly listmethods any hashkeys isa); use v5.10; use strict;