Skip to content

Commit

Permalink
fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshannan committed Feb 26, 2019
1 parent 4df24db commit efc5716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nats/io/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def connect(self,
self._status = Client.CONNECTING
yield self._process_connect_init()
break
except ErrNoServers:
raise
except Exception as e:
self._status = Client.DISCONNECTED
self._err = e
Expand Down
7 changes: 5 additions & 2 deletions tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,13 @@ def disconnected_cb(self):
"read_chunk_size": 10,
"error_cb": c.error_cb,
"close_cb": c.close_cb,
"disconnected_cb": c.disconnected_cb
"disconnected_cb": c.disconnected_cb,
"max_reconnect_attempts": 1,
}
with self.assertRaises(tornado.iostream.StreamBufferFullError):
with self.assertRaises(ErrNoServers):
yield c.nc.connect(**options)
self.assertEqual(
tornado.iostream.StreamBufferFullError, c.nc.last_error().__class__)
self.assertFalse(c.nc.is_connected)
self.assertEqual(1024, c.nc._max_read_buffer_size)
self.assertEqual(50, c.nc._max_write_buffer_size)
Expand Down

0 comments on commit efc5716

Please sign in to comment.