mirror of https://github.com/scrapy/scrapy.git
fix: disable redundant logs
- while testing the job exceeded the maximum log length and was terminated - reduce the number of requests from 20 to 10
This commit is contained in:
parent
26ab3e4137
commit
50dd9271b4
|
|
@ -226,14 +226,6 @@ class Stream:
|
|||
self.remaining_content_length = self.remaining_content_length - chunk_size
|
||||
|
||||
self.remaining_content_length = max(0, self.remaining_content_length)
|
||||
logger.debug(
|
||||
"{stream} sending {received}/{expected} data bytes ({frames} frames) to {ip_address}".format(
|
||||
stream=self,
|
||||
received=self.content_length - self.remaining_content_length,
|
||||
expected=self.content_length,
|
||||
frames=data_frames_sent,
|
||||
ip_address=self._conn_metadata['ip_address'])
|
||||
)
|
||||
|
||||
# End the stream if no more data needs to be send
|
||||
if self.remaining_content_length == 0:
|
||||
|
|
|
|||
|
|
@ -175,9 +175,6 @@ class Https2ClientProtocolTestCase(TestCase):
|
|||
client_endpoint = SSL4ClientEndpoint(reactor, self.hostname, self.port_number, client_options)
|
||||
self.client = yield client_endpoint.connect(h2_client_factory)
|
||||
|
||||
# Increase the total time taken for each tests
|
||||
self.timeout = 180 # default is 120 seconds
|
||||
|
||||
@inlineCallbacks
|
||||
def tearDown(self):
|
||||
if self.client.is_connected:
|
||||
|
|
@ -231,21 +228,21 @@ class Https2ClientProtocolTestCase(TestCase):
|
|||
request = Request(self.get_url('/get-data-html-large'))
|
||||
return self._check_GET(request, Data.HTML_LARGE, 200)
|
||||
|
||||
def _check_GET_x20(self, *args, **kwargs):
|
||||
def _check_GET_x10(self, *args, **kwargs):
|
||||
def get_deferred():
|
||||
return self._check_GET(*args, **kwargs)
|
||||
|
||||
return self._check_repeat(get_deferred, 20)
|
||||
return self._check_repeat(get_deferred, 10)
|
||||
|
||||
def test_GET_small_body_x20(self):
|
||||
return self._check_GET_x20(
|
||||
def test_GET_small_body_x10(self):
|
||||
return self._check_GET_x10(
|
||||
Request(self.get_url('/get-data-html-small')),
|
||||
Data.HTML_SMALL,
|
||||
200
|
||||
)
|
||||
|
||||
def test_GET_large_body_x20(self):
|
||||
return self._check_GET_x20(
|
||||
def test_GET_large_body_x10(self):
|
||||
return self._check_GET_x10(
|
||||
Request(self.get_url('/get-data-html-large')),
|
||||
Data.HTML_LARGE,
|
||||
200
|
||||
|
|
@ -309,24 +306,24 @@ class Https2ClientProtocolTestCase(TestCase):
|
|||
200
|
||||
)
|
||||
|
||||
def _check_POST_json_x20(self, *args, **kwargs):
|
||||
def _check_POST_json_x10(self, *args, **kwargs):
|
||||
def get_deferred():
|
||||
return self._check_POST_json(*args, **kwargs)
|
||||
|
||||
return self._check_repeat(get_deferred, 20)
|
||||
return self._check_repeat(get_deferred, 10)
|
||||
|
||||
def test_POST_small_json_x20(self):
|
||||
def test_POST_small_json_x10(self):
|
||||
request = JsonRequest(url=self.get_url('/post-data-json-small'), method='POST', data=Data.JSON_SMALL)
|
||||
return self._check_POST_json_x20(
|
||||
return self._check_POST_json_x10(
|
||||
request,
|
||||
Data.JSON_SMALL,
|
||||
Data.EXTRA_SMALL,
|
||||
200
|
||||
)
|
||||
|
||||
def test_POST_large_json_x20(self):
|
||||
def test_POST_large_json_x10(self):
|
||||
request = JsonRequest(url=self.get_url('/post-data-json-large'), method='POST', data=Data.JSON_LARGE)
|
||||
return self._check_POST_json_x20(
|
||||
return self._check_POST_json_x10(
|
||||
request,
|
||||
Data.JSON_LARGE,
|
||||
Data.EXTRA_LARGE,
|
||||
|
|
|
|||
Loading…
Reference in New Issue