Mercurial > hg > nginx-tests
comparison proxy_cache_lock.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 | ee7e07d826b8 |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
951:9361c7eddfc1 | 952:e9064d691790 |
---|---|
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:8080; | 41 listen 127.0.0.1:%%PORT_0%%; |
42 server_name localhost; | 42 server_name localhost; |
43 | 43 |
44 location / { | 44 location / { |
45 proxy_pass http://127.0.0.1:8081; | 45 proxy_pass http://127.0.0.1:%%PORT_1%%; |
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:8081; | 52 proxy_pass http://127.0.0.1:%%PORT_1%%; |
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:8081; | 60 proxy_pass http://127.0.0.1:%%PORT_1%%; |
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:8081'); | 72 $t->waitforsocket('127.0.0.1:' . port(1)); |
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:8081', | 129 LocalAddr => '127.0.0.1:' . port(1), |
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 |