diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-22 18:52:35 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-22 18:52:35 +0300 |
commit | 5d15d8449d09adbf66f465e862d4acfa86006d16 (patch) | |
tree | 33e954730646662f391142bcd35ddd106d1a4e98 /test | |
parent | 1c56579ebdc1de513f4acfd6c9d8596675716e30 (diff) | |
download | unit-5d15d8449d09adbf66f465e862d4acfa86006d16.tar.gz unit-5d15d8449d09adbf66f465e862d4acfa86006d16.tar.bz2 |
Tests: read_timeout increased for incomplete requests.
Also fixed test without \"Host\" header.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_access_log.py | 14 | ||||
-rw-r--r-- | test/test_python_application.py | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/test/test_access_log.py b/test/test_access_log.py index f1dae8ea..e2358ce2 100644 --- a/test/test_access_log.py +++ b/test/test_access_log.py @@ -1,6 +1,7 @@ import os import re import time +import unittest from subprocess import call from unit.applications.lang.python import TestApplicationPython @@ -179,7 +180,7 @@ Connection: close self.assertEqual(self.post()['status'], 200, 'init') - self.http(b"""GE""", raw=True, read_timeout=1) + resp = self.http(b"""GE""", raw=True, read_timeout=5) self.stop() @@ -192,7 +193,7 @@ Connection: close self.assertEqual(self.post()['status'], 200, 'init') - self.http(b"""GET /\n""", raw=True, read_timeout=1) + self.http(b"""GET /\n""", raw=True) self.stop() @@ -205,7 +206,7 @@ Connection: close self.assertEqual(self.post()['status'], 200, 'init') - self.http(b"""GET / HTTP/1.1""", raw=True, read_timeout=1) + resp = self.http(b"""GET / HTTP/1.1""", raw=True, read_timeout=5) self.stop() @@ -218,7 +219,7 @@ Connection: close self.assertEqual(self.post()['status'], 200, 'init') - resp = self.http(b"""GET / HTTP/1.1\n""", raw=True, read_timeout=1) + resp = self.http(b"""GET / HTTP/1.1\n""", raw=True, read_timeout=5) self.stop() @@ -227,17 +228,18 @@ Connection: close 'partial 4', ) + @unittest.expectedFailure def test_access_log_partial_5(self): self.load('empty') self.assertEqual(self.post()['status'], 200, 'init') - self.http(b"""GET / HTTP/1.1\n\n""", raw=True, read_timeout=1) + self.get(headers={'Connection': 'close'}) self.stop() self.assertIsNotNone( - self.wait_for_record(r'"GET / HTTP/1.1" 200 0 "-" "-"'), + self.wait_for_record(r'"GET / HTTP/1.1" 400 \d+ "-" "-"'), 'partial 5', ) diff --git a/test/test_python_application.py b/test/test_python_application.py index 6c310ecc..337dfcc3 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -294,7 +294,7 @@ class TestPythonApplication(TestApplicationPython): """, start=True, raw=True, - read_timeout=1, + read_timeout=5, ) self.assertIn( |