changeset 551:28a8248740ca

Tests: proxy cache lock tests adjusted. Sometimes, events for expired proxy_cache_lock_timeout may be processed out of order, notably with Solaris devpoll, which leads to spurious test failures. Tests are modified to sustain such disorder.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 21 Apr 2015 14:52:50 +0300
parents a04b8b9537cd
children 93af034fda47
files proxy_cache_lock.t
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_cache_lock.t
+++ b/proxy_cache_lock.t
@@ -69,7 +69,7 @@ EOF
 
 $t->run_daemon(\&http_fake_daemon);
 
-$t->run()->plan(19);
+$t->run()->plan(18);
 
 $t->waitforsocket('127.0.0.1:8081');
 
@@ -101,9 +101,12 @@ for my $i (1 .. 3) {
 	$sockets[$i] = http_get('/timeout', start => 1);
 }
 
-for my $i (1 .. 3) {
-	like(http_end($sockets[$i]), qr/request $i/, 'lock timeout ' . $i);
-}
+like(http_end($sockets[1]), qr/request 1/, 'lock timeout - first');
+
+my $rest = http_end($sockets[2]);
+$rest .= http_end($sockets[3]);
+
+like($rest, qr/request (2.*request 3|3.*request 2)/s, 'lock timeout - rest');
 
 TODO: {
 local $TODO = 'behavior change' unless $t->has_version('1.7.8');