summaryrefslogtreecommitdiffhomepage
path: root/test/test_settings.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-02-27 19:43:14 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-02-27 19:43:14 +0300
commitbd77c9a4d2b0f6f609e033060a5486c0afe6b19e (patch)
tree2a8c4475f96d5a8195451728318e68c67a5c4fb6 /test/test_settings.py
parent4de2c8b56719fce6b95b6f8a613b349590a3676f (diff)
downloadunit-bd77c9a4d2b0f6f609e033060a5486c0afe6b19e.tar.gz
unit-bd77c9a4d2b0f6f609e033060a5486c0afe6b19e.tar.bz2
Tests: read_timeout option introduced.
Also, increased default select() timeout from 1s to 5s.
Diffstat (limited to 'test/test_settings.py')
-rw-r--r--test/test_settings.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/test_settings.py b/test/test_settings.py
index 324042f9..13bfad49 100644
--- a/test/test_settings.py
+++ b/test/test_settings.py
@@ -14,7 +14,7 @@ class TestUnitSettings(unit.TestUnitApplicationPython):
self.conf({'http': { 'header_read_timeout': 2 }}, 'settings')
(resp, sock) = self.http(b"""GET / HTTP/1.1
-""", start=True, raw=True)
+""", start=True, read_timeout=1, raw=True)
time.sleep(3)
@@ -31,17 +31,17 @@ Connection: close
self.conf({'http': { 'header_read_timeout': 4 }}, 'settings')
(resp, sock) = self.http(b"""GET / HTTP/1.1
-""", start=True, raw=True, no_recv=True)
+""", start=True, read_timeout=1, raw=True, no_recv=True)
time.sleep(2)
(resp, sock) = self.http(b"""Host: localhost
-""", start=True, sock=sock, raw=True, no_recv=True)
+""", start=True, sock=sock, read_timeout=1, raw=True, no_recv=True)
time.sleep(2)
(resp, sock) = self.http(b"""X-Blah: blah
-""", start=True, sock=sock, raw=True)
+""", start=True, sock=sock, read_timeout=1, raw=True)
if len(resp) != 0:
sock.close()
@@ -66,7 +66,7 @@ Host: localhost
Content-Length: 10
Connection: close
-""", start=True, raw_resp=True, raw=True)
+""", start=True, raw_resp=True, read_timeout=1, raw=True)
time.sleep(3)
@@ -84,15 +84,17 @@ Host: localhost
Content-Length: 10
Connection: close
-""", start=True, raw=True)
+""", start=True, read_timeout=1, raw=True)
time.sleep(2)
- (resp, sock) = self.http(b"""012""", start=True, sock=sock, raw=True)
+ (resp, sock) = self.http(b"""012""", start=True, sock=sock,
+ read_timeout=1, raw=True)
time.sleep(2)
- (resp, sock) = self.http(b"""345""", start=True, sock=sock, raw=True)
+ (resp, sock) = self.http(b"""345""", start=True, sock=sock,
+ read_timeout=1, raw=True)
time.sleep(2)
@@ -143,7 +145,7 @@ Connection: close
(resp, sock) = self.get(headers={
'Host': 'localhost',
'Connection': 'keep-alive'
- }, start=True)
+ }, start=True, read_timeout=1)
time.sleep(3)