fix: increase timeout to 0.5 seconds

- In Windows specifically the reactor was left unclean by the
  HostnameEndpoint due to the tearDown method of
  test_downloader_handlers.py::HttpTestCase due to
  which the following 2 tests were failing:
  1. test_timeout_download_from_spider_server_hangs
  2. test_timeout_download_from_spider_nodata_rcvd
- Increasing the timeout fixed the test (in local)
This commit is contained in:
adityaa30 2020-08-17 03:47:17 +05:30
parent 38d361792c
commit 75fe3d1365
3 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ ignore_errors = True
[mypy-tests.test_downloader_handlers]
ignore_errors = True
[mypy-tests.test_download_handlers_http2]
[mypy-tests.test_downloader_handlers_http2]
ignore_errors = True
[mypy-tests.test_engine]

View File

@ -287,7 +287,7 @@ class HttpTestCase(unittest.TestCase):
def test_timeout_download_from_spider_nodata_rcvd(self):
# client connects but no data is received
spider = Spider('foo')
meta = {'download_timeout': 0.2}
meta = {'download_timeout': 0.5}
request = Request(self.getURL('wait'), meta=meta)
d = self.download_request(request, spider)
yield self.assertFailure(d, defer.TimeoutError, error.TimeoutError)
@ -296,7 +296,7 @@ class HttpTestCase(unittest.TestCase):
def test_timeout_download_from_spider_server_hangs(self):
# client connects, server send headers and some body bytes but hangs
spider = Spider('foo')
meta = {'download_timeout': 0.2}
meta = {'download_timeout': 0.5}
request = Request(self.getURL('hang-after-headers'), meta=meta)
d = self.download_request(request, spider)
yield self.assertFailure(d, defer.TimeoutError, error.TimeoutError)