Mercurial > hg > nginx-tests
changeset 233:1a5574d84917
Tests: tweak various timeouts and replace sleep() with select().
Hopefully this will result in less spurious test failures, in particular
on our Solaris VM.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 10 Sep 2012 20:18:05 +0400 |
parents | 4c43b3a0117c |
children | 62114a0c1389 |
files | proxy_cache.t proxy_cache_lock.t proxy_store.t |
diffstat | 3 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/proxy_cache.t Mon Sep 10 19:55:12 2012 +0400 +++ b/proxy_cache.t Mon Sep 10 20:18:05 2012 +0400 @@ -101,7 +101,7 @@ like(http_get('/empty.html'), qr/HTTP/, 'empty get first'); like(http_get('/empty.html'), qr/HTTP/, 'empty get second'); -sleep(2); +select(undef, undef, undef, 1.1); unlink $t->testdir() . '/t.html'; like(http_gzip_request('/t.html'), qr/HTTP.*1c\x0d\x0a.{28}\x0d\x0a0\x0d\x0a\x0d\x0a\z/s,
--- a/proxy_cache_lock.t Mon Sep 10 19:55:12 2012 +0400 +++ b/proxy_cache_lock.t Mon Sep 10 20:18:05 2012 +0400 @@ -56,7 +56,7 @@ proxy_cache NAME; proxy_cache_lock on; - proxy_cache_lock_timeout 300ms; + proxy_cache_lock_timeout 200ms; } location /nolock { @@ -137,7 +137,7 @@ eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(2); + alarm(3); $s = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => '127.0.0.1:8080' @@ -161,7 +161,7 @@ eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(2); + alarm(3); local $/; $reply = $s->getline(); log_in($reply); @@ -204,7 +204,7 @@ next unless $uri; - sleep(1); + select(undef, undef, undef, 0.5); $num++; print $client <<"EOF";
--- a/proxy_store.t Mon Sep 10 19:55:12 2012 +0400 +++ b/proxy_store.t Mon Sep 10 20:18:05 2012 +0400 @@ -83,13 +83,13 @@ ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files'); http_get('/store-index-big.html', aborted => 1, sleep => 0.1); -sleep(1); +select(undef, undef, undef, 0.5); ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files after aborted request'); http_get('/ssi.html', aborted => 1, sleep => 0.1); -sleep(1); +select(undef, undef, undef, 0.5); ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files after aborted ssi');