mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
Update limit core tests to avoid false negative
This commit is contained in:
parent
855ae89363
commit
5d7ef69c9d
1 changed files with 4 additions and 2 deletions
|
@ -93,6 +93,7 @@ try:
|
|||
stopped = True
|
||||
break
|
||||
total = time() - start
|
||||
rate = int(limit_req_rate[:-3])
|
||||
|
||||
if use_limit_request and stopped:
|
||||
print(
|
||||
|
@ -112,7 +113,7 @@ try:
|
|||
flush=True,
|
||||
)
|
||||
exit(0)
|
||||
elif request_number < int(limit_req_rate[:-3]) + 1:
|
||||
elif request_number < rate + 1 or request_number > rate + 3:
|
||||
print(
|
||||
f"❌ The limit_req directive is not working correctly, {request_number} requests were made in {total:.2f}s while the limit was set to {limit_req_rate}, exiting ...",
|
||||
flush=True,
|
||||
|
@ -152,6 +153,7 @@ try:
|
|||
stopped = True
|
||||
break
|
||||
total = time() - start
|
||||
rate = int(limit_req_rate_1[:-3])
|
||||
|
||||
if stopped:
|
||||
print(
|
||||
|
@ -159,7 +161,7 @@ try:
|
|||
flush=True,
|
||||
)
|
||||
exit(1)
|
||||
elif request_number < int(limit_req_rate_1[:-3]) + 1:
|
||||
elif request_number < rate + 1 or request_number > rate + 3:
|
||||
print(
|
||||
f"❌ The limit_req_1 directive is not working correctly, {request_number} requests were made in {total:.2f}s while the limit was set to {limit_req_rate}, exiting ...",
|
||||
flush=True,
|
||||
|
|
Loading…
Reference in a new issue