Merge pull request #2926 from stapelberg/unflake-tests

Unflake tests
This commit is contained in:
Michael Stapelberg 2017-09-10 22:08:05 +02:00 committed by GitHub
commit 0f2bce3916
3 changed files with 18 additions and 2 deletions

View File

@ -177,11 +177,18 @@ my $timingsjson = slurp('.last_run_timings.json') if -e '.last_run_timings.json'
map { [$_, $timings{$_} // 999] } @testfiles; map { [$_, $timings{$_} // 999] } @testfiles;
# Run 000-load-deps.t first to bail out early when dependencies are missing. # Run 000-load-deps.t first to bail out early when dependencies are missing.
my $loadtest = "t/000-load-deps.t"; my ($loadtest) = grep { $_ =~ m,t/000-load-deps.t$, } @testfiles;
if ((scalar grep { $_ eq $loadtest } @testfiles) > 0) { if (defined($loadtest)) {
@testfiles = ($loadtest, grep { $_ ne $loadtest } @testfiles); @testfiles = ($loadtest, grep { $_ ne $loadtest } @testfiles);
} }
# Run 533-randr15.t last because it destructively modifies the RandR
# configuration of the X session, interfering with any test started afterwards.
my ($randrtest) = grep { $_ =~ m,t/533-randr15.t$, } @testfiles;
if (defined($randrtest)) {
@testfiles = ((grep { $_ ne $randrtest } @testfiles), $randrtest);
}
printf("\nRough time estimate for this run: %.2f seconds\n\n", $timings{GLOBAL}) printf("\nRough time estimate for this run: %.2f seconds\n\n", $timings{GLOBAL})
if exists($timings{GLOBAL}); if exists($timings{GLOBAL});

View File

@ -99,6 +99,11 @@ sub worker_wait {
$0 = $file; $0 = $file;
# Re-seed rand() so that File::Temps tempnam produces different
# results, making a TOCTOU between e.g. t/175-startup-notification.t
# and t/180-fd-leaks.t less likely.
srand(time ^ $$);
POSIX::dup2($ipc_fd, 0); POSIX::dup2($ipc_fd, 0);
POSIX::dup2($ipc_fd, 1); POSIX::dup2($ipc_fd, 1);
POSIX::dup2(1, 2); POSIX::dup2(1, 2);

View File

@ -147,6 +147,10 @@ ok(@{get_ws_content($tmp)} == 2, 'after split & new window, two containers');
$wscontent = get_ws($tmp); $wscontent = get_ws($tmp);
# Ensure i3s X11 requests are processed before our inquiry via
# $tilewindow->rect:
sync_with_i3;
@tiled = @{$wscontent->{nodes}}; @tiled = @{$wscontent->{nodes}};
ok(@tiled == 2, 'two tiled container opened in another container'); ok(@tiled == 2, 'two tiled container opened in another container');
is($tiled[0]->{current_border_width}, -1, 'first tiled current border width set to -1'); is($tiled[0]->{current_border_width}, -1, 'first tiled current border width set to -1');