comparison memcached_keepalive_stale.t @ 974:882267679006

Tests: simplified parallel modifications in tests. Mail tests were simplified in c227348453db.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 12 Jul 2016 17:39:03 +0300
parents e9064d691790
children
comparison
equal deleted inserted replaced
973:7d7aef8b9f3a 974:882267679006
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:%%PORT_1%%; 44 server 127.0.0.1:8081;
45 keepalive 1; 45 keepalive 1;
46 } 46 }
47 47
48 server { 48 server {
49 listen 127.0.0.1:%%PORT_0%% sndbuf=32k; 49 listen 127.0.0.1:8080 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', port(2); 68 push @memopts1, '-X', port(8082);
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', port(1), @memopts1); 81 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', port(8081), @memopts1);
82 82
83 $t->run(); 83 $t->run();
84 84
85 $t->waitforsocket('127.0.0.1:' . port(1)) 85 $t->waitforsocket('127.0.0.1:' . port(8081))
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:' . port(1) ], 90 my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:' . port(8081) ],
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.