diff options
Diffstat (limited to 'test/test_server.py')
-rw-r--r-- | test/test_server.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/test_server.py b/test/test_server.py index 829b5f0a..4a5dd7c2 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -522,13 +522,13 @@ class TestProxy(tservers.HTTPProxTest): assert f.response.code == 304 def test_response_timestamps(self): - # test that we notice at least 2 sec delay between timestamps + # test that we notice at least 1 sec delay between timestamps # in response object f = self.pathod("304:b@1k:p50,1") assert f.status_code == 304 response = self.master.state.view[0].response - assert 1 <= response.timestamp_end - response.timestamp_start <= 1.2 + assert 0.9 <= response.timestamp_end - response.timestamp_start <= 1.2 def test_request_timestamps(self): # test that we notice a delay between timestamps in request object @@ -547,8 +547,9 @@ class TestProxy(tservers.HTTPProxTest): request, response = self.master.state.view[ 0].request, self.master.state.view[0].response assert response.code == 304 # sanity test for our low level request - # time.sleep might be a little bit shorter than a second - assert 0.95 < (request.timestamp_end - request.timestamp_start) < 1.2 + # time.sleep might be a little bit shorter than a second, + # we observed up to 0.93s on appveyor. + assert 0.8 < (request.timestamp_end - request.timestamp_start) < 1.2 def test_request_timestamps_not_affected_by_client_time(self): # test that don't include user wait time in request's timestamps @@ -711,7 +712,7 @@ class TestStreamRequest(tservers.HTTPProxTest): connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connection.connect(("127.0.0.1", self.proxy.port)) fconn = connection.makefile() - spec = '200:h"Transfer-Encoding"="chunked":r:b"4\\r\\nthis\\r\\n7\\r\\nisatest\\r\\n0\\r\\n\\r\\n"' + spec = '200:h"Transfer-Encoding"="chunked":r:b"4\\r\\nthis\\r\\n11\\r\\nisatest__reachhex\\r\\n0\\r\\n\\r\\n"' connection.send( "GET %s/p/%s HTTP/1.1\r\n" % (self.server.urlbase, spec)) @@ -726,7 +727,7 @@ class TestStreamRequest(tservers.HTTPProxTest): chunks = list(protocol.read_http_body_chunked( resp.headers, None, "GET", 200, False )) - assert chunks == ["this", "isatest", ""] + assert chunks == ["this", "isatest__reachhex"] connection.close() |