Changeset ca37e8 for upstream_keepalive/t/memcached-keepalive.t
- Timestamp:
- 01/16/09 19:58:58 (3 years ago)
- Branches:
- master-v0.7, upstream_count_limit
- Children:
- cd26d0
- Parents:
- 3f2f24
- git-author:
- George Potapov <nephrite@…> (01/16/09 19:58:58)
- git-committer:
- George Potapov <nephrite@…> (01/16/09 19:58:58)
- File:
-
- 1 edited
-
upstream_keepalive/t/memcached-keepalive.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
upstream_keepalive/t/memcached-keepalive.t
r2904d4 rca37e8 21 21 plain(skip_all => 'Cache::Memcached not installed') if $@; 22 22 23 my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(1 0)23 my $t = Test::Nginx->new()->has('rewrite')->has_daemon('memcached')->plan(16) 24 24 ->write_file_expand('nginx.conf', <<'EOF'); 25 25 … … 95 95 EOF 96 96 97 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); 98 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); 97 if (`memcached -h` =~ /repcached/) { 98 # repcached patches adds additional listen socket memcached 99 # that should be different too 100 101 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081', 102 '-X', '8091'); 103 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082', 104 '-X', '8092'); 105 106 } else { 107 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); 108 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); 109 } 110 99 111 $t->run(); 112 113 $t->waitforsocket('127.0.0.1:8081') 114 or die "Unable to start memcached"; 115 $t->waitforsocket('127.0.0.1:8082') 116 or die "Unable to start second memcached"; 100 117 101 118 ############################################################################### … … 106 123 $memd1->set('/', 'SEE-THIS'); 107 124 $memd2->set('/', 'SEE-THIS'); 125 $memd1->set('/big', 'X' x 1000000); 108 126 109 127 my $total = $memd1->stats()->{total}->{total_connections}; … … 120 138 'only one connection used'); 121 139 140 # Since nginx doesn't read all data from connection in some situations (head 141 # requests, post_action, errors writing to client) we have to close such 142 # connections. Check if we really do close them. 143 144 $total = $memd1->stats()->{total}->{total_connections}; 145 146 unlike(http_head('/'), qr/SEE-THIS/, 'head request'); 147 like(http_get('/'), qr/SEE-THIS/, 'get after head'); 148 149 is($memd1->stats()->{total}->{total_connections}, $total + 1, 150 'head request closes connection'); 151 152 $total = $memd1->stats()->{total}->{total_connections}; 153 154 unlike(http_head('/big'), qr/XXX/, 'big head'); 155 like(http_get('/'), qr/SEE-THIS/, 'get after big head'); 156 157 is($memd1->stats()->{total}->{total_connections}, $total + 1, 158 'big head request closes connection'); 159 122 160 # two backends with 'single' option - should establish only one connection 123 161
Note: See TracChangeset
for help on using the changeset viewer.
