From c5963a978abb76ca4cf19ddd4438813de16da203 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 6 Mar 2024 14:26:35 +0100 Subject: [PATCH] Added timeout to fetch method --- caimira/tests/apps/calculator/test_webapp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/caimira/tests/apps/calculator/test_webapp.py b/caimira/tests/apps/calculator/test_webapp.py index dc6ea769..a9fd52f3 100644 --- a/caimira/tests/apps/calculator/test_webapp.py +++ b/caimira/tests/apps/calculator/test_webapp.py @@ -41,7 +41,7 @@ class TestBasicApp(tornado.testing.AsyncHTTPTestCase): @tornado.testing.gen_test(timeout=_TIMEOUT) def test_report(self): requests = [ - self.http_client.fetch(self.get_url('/calculator/baseline-model/result')), + self.http_client.fetch(self.get_url('/calculator/baseline-model/result'), request_timeout=_TIMEOUT), # At the same time, request a non-report page (to check whether the report is blocking). self.http_client.fetch(self.get_url('/calculator/')), ] @@ -69,7 +69,7 @@ class TestCernApp(tornado.testing.AsyncHTTPTestCase): @tornado.testing.gen_test(timeout=_TIMEOUT) def test_report(self): - response = yield self.http_client.fetch(self.get_url('/calculator/baseline-model/result')) + response = yield self.http_client.fetch(self.get_url('/calculator/baseline-model/result'), request_timeout=_TIMEOUT) self.assertEqual(response.code, 200) assert 'expected number of new cases is' in response.body.decode() @@ -80,7 +80,7 @@ class TestOpenApp(tornado.testing.AsyncHTTPTestCase): @tornado.testing.gen_test(timeout=_TIMEOUT) def test_report(self): - response = yield self.http_client.fetch(self.get_url('/mycalc/baseline-model/result')) + response = yield self.http_client.fetch(self.get_url('/mycalc/baseline-model/result'), request_timeout=_TIMEOUT) self.assertEqual(response.code, 200) def test_calculator_404(self):