Skip to content

Commit

Permalink
test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Nov 2, 2021
1 parent 1bb3ada commit be8ddf7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions locust/test/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ def test_catch_response_multiple_failure_and_success(self):
self.assertEqual(1, self.environment.stats.total.num_requests)
self.assertEqual(0, self.environment.stats.total.num_failures)

def test_catch_response_timeout(self):
s = self.get_client()
with s.get("/slow", catch_response=True, timeout=0.1) as r:
self.assertAlmostEqual(r.request_meta["response_time"], 100, delta=50)
self.assertEqual(1, self.environment.stats.total.num_requests)
self.assertEqual(1, self.environment.stats.total.num_failures)

def test_catch_response_pass_failed_request_with_other_exception_within_block(self):
class OtherException(Exception):
pass
Expand Down

0 comments on commit be8ddf7

Please sign in to comment.