fix request_timestamps test case

This commit is contained in:
Maximilian Hils 2013-06-18 00:54:07 +02:00
parent ca9740df20
commit 6fe175913e
1 changed files with 2 additions and 1 deletions

View File

@ -256,13 +256,14 @@ class TestProxy(tservers.HTTPProxTest):
# call pathod server, wait a second to complete the request # call pathod server, wait a second to complete the request
connection.send("GET http://localhost:%d/p/304:b@1k HTTP/1.1\r\n"%self.server.port) connection.send("GET http://localhost:%d/p/304:b@1k HTTP/1.1\r\n"%self.server.port)
time.sleep(1)
connection.send("\r\n"); connection.send("\r\n");
connection.recv(50000) connection.recv(50000)
connection.close() connection.close()
request, response = self.master.state.view[0].request, self.master.state.view[0].response 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 assert response.code == 304 # sanity test for our low level request
assert request.timestamp_end - request.timestamp_start > 0 assert 0.95 < (request.timestamp_end - request.timestamp_start) < 1.2 #time.sleep might be a little bit shorter than a second
def test_request_timestamps_not_affected_by_client_time(self): def test_request_timestamps_not_affected_by_client_time(self):
# test that don't include user wait time in request's timestamps # test that don't include user wait time in request's timestamps