Skip to content

Commit

Permalink
tests(rate-limiting): fix a flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Oct 9, 2023
1 parent 6b3d3c5 commit 50a7fe9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/03-plugins/23-rate-limiting/04-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ if limit_by == "ip" then
assert
.with_timeout(15)
.with_max_tries(10)
.with_step(0.5) -- the windows is 1 second, we wait 0.5 seconds between each retry,
-- that can avoid some unlucky case (we are at the end of the window)
.ignore_exceptions(false)
.eventually(function()
local res1 = GET(test_path, { headers = { ["X-Real-IP"] = "127.0.0.3" }})
Expand Down

0 comments on commit 50a7fe9

Please sign in to comment.