* Make the Quake 3 test less timing-sensitive.

svn path=/nixos/trunk/; revision=19816
This commit is contained in:
Eelco Dolstra 2010-02-04 13:59:31 +00:00
parent 0f56bd755a
commit 5b60c280d7
2 changed files with 12 additions and 3 deletions

View File

@ -216,6 +216,15 @@ sub mustSucceed {
}
sub waitUntilSucceeds {
my ($self, $command) = @_;
retry sub {
my ($status, $out) = $self->execute($command);
return 1 if $status == 0;
};
}
sub mustFail {
my ($self, $command) = @_;
my ($status, $out) = $self->execute($command);

View File

@ -39,10 +39,10 @@ rec {
$client1->execute("quake3 '+set r_fullscreen 0' '+set name Foo' '+connect server' &");
$client2->execute("quake3 '+set r_fullscreen 0' '+set name Bar' '+connect server' &");
sleep 40;
$server->waitUntilSucceeds("grep -q 'Foo.*entered the game' /tmp/log");
$server->waitUntilSucceeds("grep -q 'Bar.*entered the game' /tmp/log");
$server->mustSucceed("grep -q 'Foo.*entered the game' /tmp/log");
$server->mustSucceed("grep -q 'Bar.*entered the game' /tmp/log");
sleep 30; # wait for a while to get a nice screenshot
$client1->screenshot("screen1");
$client2->screenshot("screen2");