Mercurial > hg > nginx-tests
comparison memcached_keepalive_stale.t @ 952:e9064d691790
Tests: converted tests to run in parallel.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jun 2016 16:39:13 +0300 |
parents | 6c0a5903d0ae |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
951:9361c7eddfc1 | 952:e9064d691790 |
---|---|
39 | 39 |
40 http { | 40 http { |
41 %%TEST_GLOBALS_HTTP%% | 41 %%TEST_GLOBALS_HTTP%% |
42 | 42 |
43 upstream memd { | 43 upstream memd { |
44 server 127.0.0.1:8081; | 44 server 127.0.0.1:%%PORT_1%%; |
45 keepalive 1; | 45 keepalive 1; |
46 } | 46 } |
47 | 47 |
48 server { | 48 server { |
49 listen 127.0.0.1:8080 sndbuf=32k; | 49 listen 127.0.0.1:%%PORT_0%% sndbuf=32k; |
50 server_name localhost; | 50 server_name localhost; |
51 | 51 |
52 location / { | 52 location / { |
53 set $memcached_key $uri; | 53 set $memcached_key $uri; |
54 memcached_pass memd; | 54 memcached_pass memd; |
63 | 63 |
64 if ($memhelp =~ /repcached/) { | 64 if ($memhelp =~ /repcached/) { |
65 # repcached patches adds additional listen socket memcached | 65 # repcached patches adds additional listen socket memcached |
66 # that should be different too | 66 # that should be different too |
67 | 67 |
68 push @memopts1, '-X', '8091'; | 68 push @memopts1, '-X', port(2); |
69 } | 69 } |
70 if ($memhelp =~ /-U/) { | 70 if ($memhelp =~ /-U/) { |
71 # UDP ports no longer off by default in memcached 1.2.7+ | 71 # UDP ports no longer off by default in memcached 1.2.7+ |
72 | 72 |
73 push @memopts1, '-U', '0'; | 73 push @memopts1, '-U', '0'; |
76 # for connection stats consistency in threaded memcached 1.3+ | 76 # for connection stats consistency in threaded memcached 1.3+ |
77 | 77 |
78 push @memopts1, '-t', '1'; | 78 push @memopts1, '-t', '1'; |
79 } | 79 } |
80 | 80 |
81 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081', @memopts1); | 81 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', port(1), @memopts1); |
82 | 82 |
83 $t->run(); | 83 $t->run(); |
84 | 84 |
85 $t->waitforsocket('127.0.0.1:8081') | 85 $t->waitforsocket('127.0.0.1:' . port(1)) |
86 or die "Unable to start memcached"; | 86 or die "Unable to start memcached"; |
87 | 87 |
88 ############################################################################### | 88 ############################################################################### |
89 | 89 |
90 my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], | 90 my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:' . port(1) ], |
91 connect_timeout => 1.0); | 91 connect_timeout => 1.0); |
92 | 92 |
93 # It's possible that stale events occur, i.e. read event handler called | 93 # It's possible that stale events occur, i.e. read event handler called |
94 # for just saved upstream connection without any data available for | 94 # for just saved upstream connection without any data available for |
95 # read. We shouldn't close upstream connection in such situation. | 95 # read. We shouldn't close upstream connection in such situation. |