mirror of
https://github.com/sprockets/sprockets.mixins.metrics.git
synced 2024-11-21 19:28:34 +00:00
Add reconnect logic test.
This commit is contained in:
parent
08b3cf206b
commit
5ced9be0be
1 changed files with 7 additions and 0 deletions
7
tests.py
7
tests.py
|
@ -155,6 +155,13 @@ class TCPStatsdMetricCollectionTests(testing.AsyncHTTPTestCase):
|
|||
self.assertEqual(expected,
|
||||
list(self.statsd.find_metrics(expected, 'ms'))[0][0])
|
||||
|
||||
def test_reconnect_logic(self):
|
||||
self.application.statsd._tcp_reconnect_sleep = 0.05
|
||||
self.application.statsd._sock.close()
|
||||
asyncio.get_event_loop().run_until_complete(asyncio.sleep(0.075))
|
||||
response = self.fetch('/status_code')
|
||||
self.assertEqual(response.code, 200)
|
||||
|
||||
|
||||
class TCPStatsdConfigurationTests(testing.AsyncHTTPTestCase):
|
||||
|
||||
|
|
Loading…
Reference in a new issue