mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix tcp message client test
This commit is contained in:
parent
3419bf59b5
commit
f5313fd17d
2 changed files with 5 additions and 3 deletions
|
@ -1030,7 +1030,8 @@ class SaltMessageClient(object):
|
|||
**kwargs)
|
||||
self._connecting_future.set_result(True)
|
||||
break
|
||||
except Exception as e:
|
||||
except Exception as exc:
|
||||
log.warn('TCP Message Client encountered an exception %r', exc)
|
||||
yield tornado.gen.sleep(1) # TODO: backoff
|
||||
#self._connecting_future.set_exception(e)
|
||||
|
||||
|
|
|
@ -319,10 +319,11 @@ class SaltMessageClientPoolTest(AsyncTestCase):
|
|||
class SaltMessageClientCleanupTest(TestCase, AdaptedConfigurationTestCaseMixin):
|
||||
|
||||
def setUp(self):
|
||||
self.listen_on = '127.0.0.1'
|
||||
self.port = get_unused_localhost_port()
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
self.sock.bind(('localhost', self.port))
|
||||
self.sock.bind((self.listen_on, self.port))
|
||||
self.sock.listen(1)
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -336,7 +337,7 @@ class SaltMessageClientCleanupTest(TestCase, AdaptedConfigurationTestCaseMixin):
|
|||
orig_loop = tornado.ioloop.IOLoop()
|
||||
orig_loop.make_current()
|
||||
opts = self.get_temp_config('master')
|
||||
client = SaltMessageClient(opts, 'localhost', self.port)
|
||||
client = SaltMessageClient(opts, self.listen_on, self.port)
|
||||
|
||||
# Mock the io_loop's stop method so we know when it has been called.
|
||||
orig_loop.real_stop = orig_loop.stop
|
||||
|
|
Loading…
Add table
Reference in a new issue