testcases: fix race conditions in various tests

This commit is contained in:
Maik Fischer
2011-11-21 16:49:22 +01:00
committed by Michael Stapelberg
parent af793c9030
commit 0f386a96e7
4 changed files with 33 additions and 22 deletions

View File

@ -8,13 +8,17 @@
#
use i3test;
use List::Util qw(sum);
use X11::XCB::Connection;
my $x = X11::XCB::Connection->new;
my $tmp = fresh_workspace;
cmd 'exec /usr/bin/urxvt';
sleep 0.5;
wait_for_map $x;
cmd 'exec /usr/bin/urxvt';
sleep 0.5;
wait_for_map $x;
my ($nodes, $focus) = get_ws_content($tmp);
my $old_sum = sum map { $_->{rect}->{width} } @{$nodes};
#cmd 'open';
@ -22,12 +26,13 @@ cmd 'resize grow left 10 px or 25 ppt';
cmd 'split v';
#cmd 'open';
cmd 'exec /usr/bin/urxvt';
sleep 0.5;
cmd 'mode toggle';
sleep 0.5;
cmd 'kill';
wait_for_map $x;
sleep 0.5;
cmd 'mode toggle';
sync_with_i3 $x;
cmd 'kill';
wait_for_unmap $x;
($nodes, $focus) = get_ws_content($tmp);
my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};