Attempt to fix failing testMetadataOnPost functional test

On Jenkins, functional tests occasionally fail in testMetadataOnPost test case
with ResponseNotReady exception. This is an attempt to fix that as I'm
guessing that the following could be the reason.

It is advised to read the whole response body before sending a new request:
http://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.getresponse
http://hg.python.org/cpython/file/2.7/Lib/httplib.py#l1033

Change-Id: I2ee880fd15af8766dcbd12f84ef561a67acdcdce
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/6945
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
This commit is contained in:
Prashanth Pai 2014-02-10 15:19:20 +05:30 committed by Chetan Risbud
parent 3ee9a70402
commit ad6fb35580

View File

@ -302,6 +302,7 @@ class Connection(object):
self.connection.send('0\r\n\r\n')
self.response = self.connection.getresponse()
self.response.read()
self.connection.close()
return self.response.status