Fix MAX_TIMEOUT value for listener
In the database, timeout_client_data, timeout_member_connect, timeout_member_data, timeout_tcp_inspect have an integer type with a maximum size of 2147483647. Now MAX_TIMEOUT in API does not exceed this value and is equal to 24 days (2073600000 seconds). Story: 2009193 Task: 43248 Change-Id: I990b6af1ff880b25e54f6c41ae0c966007f3f098
This commit is contained in:
parent
69d975d623
commit
3a8f056306
@ -232,8 +232,8 @@ DEFAULT_MAX_RETRIES_DOWN = 3
|
|||||||
MIN_HM_RETRIES = 1
|
MIN_HM_RETRIES = 1
|
||||||
MAX_HM_RETRIES = 10
|
MAX_HM_RETRIES = 10
|
||||||
|
|
||||||
# 1 year: y d h m ms
|
# 24 days: days d h m ms
|
||||||
MAX_TIMEOUT = 365 * 24 * 60 * 60 * 1000
|
MAX_TIMEOUT = 24 * 24 * 60 * 60 * 1000
|
||||||
MIN_TIMEOUT = 0
|
MIN_TIMEOUT = 0
|
||||||
|
|
||||||
DEFAULT_TIMEOUT_CLIENT_DATA = 50000
|
DEFAULT_TIMEOUT_CLIENT_DATA = 50000
|
||||||
|
@ -683,17 +683,21 @@ class TestListener(base.BaseAPITest):
|
|||||||
def test_create_with_timeouts_too_high(self):
|
def test_create_with_timeouts_too_high(self):
|
||||||
optionals = {
|
optionals = {
|
||||||
'timeout_client_data': 1,
|
'timeout_client_data': 1,
|
||||||
'timeout_member_connect': 2,
|
'timeout_member_connect': 1,
|
||||||
'timeout_member_data': 3,
|
'timeout_member_data': 1,
|
||||||
'timeout_tcp_inspect': constants.MAX_TIMEOUT + 1,
|
'timeout_tcp_inspect': 1,
|
||||||
}
|
}
|
||||||
resp = self.test_create(response_status=400, **optionals).json
|
for field in optionals.items():
|
||||||
fault = resp.get('faultstring')
|
optionals.update({field[0]: constants.MAX_TIMEOUT + 1})
|
||||||
self.assertIn(
|
resp = self.test_create(response_status=400, **optionals).json
|
||||||
'Invalid input for field/attribute timeout_tcp_inspect', fault)
|
optionals.update({field[0]: 1})
|
||||||
self.assertIn(
|
fault = resp.get('faultstring')
|
||||||
'Value should be lower or equal to {0}'.format(
|
self.assertIn(
|
||||||
constants.MAX_TIMEOUT), fault)
|
'Invalid input for field/attribute {0}'.format(
|
||||||
|
field[0]), fault)
|
||||||
|
self.assertIn(
|
||||||
|
'Value should be lower or equal to {0}'.format(
|
||||||
|
constants.MAX_TIMEOUT), fault)
|
||||||
|
|
||||||
def test_create_with_timeouts_too_low(self):
|
def test_create_with_timeouts_too_low(self):
|
||||||
optionals = {
|
optionals = {
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixed MAX_TIMEOUT for timeout_client_data, timeout_member_connect,
|
||||||
|
timeout_member_data, timeout_tcp_inspect API listener. The value was
|
||||||
|
reduced from 365 days to 24 days, which now does not exceed the value of
|
||||||
|
the data type in DB.
|
Loading…
Reference in New Issue
Block a user