comparison proxy_cache_lock.t @ 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 071e8941e3bf
children 907e89fba9c3
comparison
equal deleted inserted replaced
550:a04b8b9537cd 551:28a8248740ca
67 67
68 EOF 68 EOF
69 69
70 $t->run_daemon(\&http_fake_daemon); 70 $t->run_daemon(\&http_fake_daemon);
71 71
72 $t->run()->plan(19); 72 $t->run()->plan(18);
73 73
74 $t->waitforsocket('127.0.0.1:8081'); 74 $t->waitforsocket('127.0.0.1:8081');
75 75
76 ############################################################################### 76 ###############################################################################
77 77
99 99
100 for my $i (1 .. 3) { 100 for my $i (1 .. 3) {
101 $sockets[$i] = http_get('/timeout', start => 1); 101 $sockets[$i] = http_get('/timeout', start => 1);
102 } 102 }
103 103
104 for my $i (1 .. 3) { 104 like(http_end($sockets[1]), qr/request 1/, 'lock timeout - first');
105 like(http_end($sockets[$i]), qr/request $i/, 'lock timeout ' . $i); 105
106 } 106 my $rest = http_end($sockets[2]);
107 $rest .= http_end($sockets[3]);
108
109 like($rest, qr/request (2.*request 3|3.*request 2)/s, 'lock timeout - rest');
107 110
108 TODO: { 111 TODO: {
109 local $TODO = 'behavior change' unless $t->has_version('1.7.8'); 112 local $TODO = 'behavior change' unless $t->has_version('1.7.8');
110 113
111 like(http_get('/timeout'), qr/request 1/, 'lock timeout - first only cached'); 114 like(http_get('/timeout'), qr/request 1/, 'lock timeout - first only cached');