Fix wrong overridden value of config option client_socket_timeout

Config option only allows the value zero which implies wait forever,
or positive integer, so we need pass positive integer. CONF.set_default
will check the value by converting it to integer, 0.1 will be converted
to 0. that leads test failure, use 1 instead.

Related-Bug: #1517839
Change-Id: I86eeff90e464faa80277823a87ab352761dd8544
This commit is contained in:
ChangBo Guo(gcb) 2017-04-28 23:49:43 +08:00
parent e1155a0a46
commit 815293738a
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class TestWSGIServer(testtools.TestCase):
"""WSGI server tests."""
def test_client_socket_timeout(self):
CONF.set_default("workers", 0)
CONF.set_default("client_socket_timeout", 0.1)
CONF.set_default("client_socket_timeout", 1)
"""Verify connections are timed out as per 'client_socket_timeout'"""
greetings = 'Hello, World!!!'
@ -52,4 +52,4 @@ class TestWSGIServer(testtools.TestCase):
# Should succeed - no timeout
self.assertIn(greetings, get_request())
# Should fail - connection timed out so we get nothing from the server
self.assertFalse(get_request(delay=0.2))
self.assertFalse(get_request(delay=1.1))