From 8065ba84aa490d1d50b4089d6102dfce6fbbfca9 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Mon, 17 Sep 2018 19:07:29 +0300 Subject: Tests: test_settings_header_read_timeout_update adjusted. --- test/test_settings.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test/test_settings.py') diff --git a/test/test_settings.py b/test/test_settings.py index 4b9304e9..816dcb5e 100644 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -25,10 +25,11 @@ Connection: close self.assertEqual(resp['status'], 408, 'status header read timeout') - @unittest.expectedFailure def test_settings_header_read_timeout_update(self): self.load('empty') + r = None + self.conf({'http': { 'header_read_timeout': 4 }}, 'settings') (resp, sock) = self.http(b"""GET / HTTP/1.1 @@ -42,11 +43,15 @@ Connection: close time.sleep(2) (resp, sock) = self.http(b"""X-Blah: blah -""", start=True, sock=sock, raw=True, no_recv=True) +""", start=True, sock=sock, raw=True) - time.sleep(2) + if len(resp) != 0: + sock.close() + + else: + time.sleep(2) - resp = self.http(b"""Connection: close + resp = self.http(b"""Connection: close """, sock=sock, raw=True) -- cgit