# HG changeset patch # User Maxim Dounin # Date 1314787396 -14400 # Node ID d099e407fff516fb75468d8bb08a840311a3d175 # Parent cfb8147f19a75b3d6b6ef57c0fc0eb6056157e60 Tests: tune sleep in limit_req.t to avoid spurious timeouts. Tune sleep and increase rate accordingly (we have to sleep for at a delay time and a bit more). This should still catch the original problem since 0.8.38 (where delay time for rates different from 1r/s was fixed). diff -r cfb8147f19a7 -r d099e407fff5 limit_req.t --- a/limit_req.t Tue Aug 30 18:32:14 2011 +0400 +++ b/limit_req.t Wed Aug 31 14:43:16 2011 +0400 @@ -35,8 +35,8 @@ http { %%TEST_GLOBALS_HTTP%% - limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; - limit_req_zone $binary_remote_addr zone=long:10m rate=1r/s; + limit_req_zone $binary_remote_addr zone=one:10m rate=2r/s; + limit_req_zone $binary_remote_addr zone=long:10m rate=2r/s; limit_req_zone $binary_remote_addr zone=fast:10m rate=1000r/s; server { @@ -74,7 +74,7 @@ # before reading response. my $l1 = length(http_get('/long.html')); -my $l2 = length(http_get('/long.html', sleep => 1.1)); +my $l2 = length(http_get('/long.html', sleep => 0.6)); is($l2, $l1, 'delayed big request not truncated'); # make sure rejected requests are not counted, and access is again allowed