Mercurial > hg > nginx-tests
comparison proxy_cache_lock.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 | 196d33c2bb45 |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
36 | 36 |
37 proxy_cache_path %%TESTDIR%%/cache levels=1:2 | 37 proxy_cache_path %%TESTDIR%%/cache levels=1:2 |
38 keys_zone=NAME:1m; | 38 keys_zone=NAME:1m; |
39 | 39 |
40 server { | 40 server { |
41 listen 127.0.0.1:%%PORT_0%%; | 41 listen 127.0.0.1:8080; |
42 server_name localhost; | 42 server_name localhost; |
43 | 43 |
44 location / { | 44 location / { |
45 proxy_pass http://127.0.0.1:%%PORT_1%%; | 45 proxy_pass http://127.0.0.1:8081; |
46 proxy_cache NAME; | 46 proxy_cache NAME; |
47 | 47 |
48 proxy_cache_lock on; | 48 proxy_cache_lock on; |
49 } | 49 } |
50 | 50 |
51 location /timeout { | 51 location /timeout { |
52 proxy_pass http://127.0.0.1:%%PORT_1%%; | 52 proxy_pass http://127.0.0.1:8081; |
53 proxy_cache NAME; | 53 proxy_cache NAME; |
54 | 54 |
55 proxy_cache_lock on; | 55 proxy_cache_lock on; |
56 proxy_cache_lock_timeout 200ms; | 56 proxy_cache_lock_timeout 200ms; |
57 } | 57 } |
58 | 58 |
59 location /nolock { | 59 location /nolock { |
60 proxy_pass http://127.0.0.1:%%PORT_1%%; | 60 proxy_pass http://127.0.0.1:8081; |
61 proxy_cache NAME; | 61 proxy_cache NAME; |
62 } | 62 } |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
67 | 67 |
68 $t->run_daemon(\&http_fake_daemon); | 68 $t->run_daemon(\&http_fake_daemon); |
69 | 69 |
70 $t->run(); | 70 $t->run(); |
71 | 71 |
72 $t->waitforsocket('127.0.0.1:' . port(1)); | 72 $t->waitforsocket('127.0.0.1:' . port(8081)); |
73 | 73 |
74 ############################################################################### | 74 ############################################################################### |
75 | 75 |
76 # sequential requests | 76 # sequential requests |
77 | 77 |
124 ############################################################################### | 124 ############################################################################### |
125 | 125 |
126 sub http_fake_daemon { | 126 sub http_fake_daemon { |
127 my $server = IO::Socket::INET->new( | 127 my $server = IO::Socket::INET->new( |
128 Proto => 'tcp', | 128 Proto => 'tcp', |
129 LocalAddr => '127.0.0.1:' . port(1), | 129 LocalAddr => '127.0.0.1:' . port(8081), |
130 Listen => 5, | 130 Listen => 5, |
131 Reuse => 1 | 131 Reuse => 1 |
132 ) | 132 ) |
133 or die "Can't create listening socket: $!\n"; | 133 or die "Can't create listening socket: $!\n"; |
134 | 134 |