comparison proxy_cache_lock.t @ 607:97e88eff1433

Tests: proxy cache lock tests adjusted similar to 28a8248740ca.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 16 Jun 2015 12:58:54 +0300
parents 6cdfd177319b
children ee7e07d826b8
comparison
equal deleted inserted replaced
606:530a3152753b 607:97e88eff1433
19 ############################################################################### 19 ###############################################################################
20 20
21 select STDERR; $| = 1; 21 select STDERR; $| = 1;
22 select STDOUT; $| = 1; 22 select STDOUT; $| = 1;
23 23
24 my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(18) 24 my $t = Test::Nginx->new()->has(qw/http proxy cache shmem/)->plan(17)
25 ->write_file_expand('nginx.conf', <<'EOF'); 25 ->write_file_expand('nginx.conf', <<'EOF');
26 26
27 %%TEST_GLOBALS%% 27 %%TEST_GLOBALS%%
28 28
29 daemon off; 29 daemon off;
111 111
112 for my $i (1 .. 3) { 112 for my $i (1 .. 3) {
113 $sockets[$i] = http_get('/nolock', start => 1); 113 $sockets[$i] = http_get('/nolock', start => 1);
114 } 114 }
115 115
116 for my $i (1 .. 3) { 116 like(http_end($sockets[1]), qr/request 1/, 'nolock - first');
117 like(http_end($sockets[$i]), qr/request $i/, 'nolock ' . $i);
118 }
119 117
118 $rest = http_end($sockets[2]);
119 $rest .= http_end($sockets[3]);
120
121 like($rest, qr/request (2.*request 3|3.*request 2)/s, 'nolock - rest');
120 like(http_get('/nolock'), qr/request 3/, 'nolock - last cached'); 122 like(http_get('/nolock'), qr/request 3/, 'nolock - last cached');
121 123
122 ############################################################################### 124 ###############################################################################
123 125
124 sub http_fake_daemon { 126 sub http_fake_daemon {