# 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 --git a/limit_req.t b/limit_req.t --- a/limit_req.t +++ b/limit_req.t @@ -35,8 +35,8 @@ events { 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 @@ http_get('/test1.html'); # 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