Skip to content

Commit 8b4155c

Browse files
committed
Try raise gevent sleep time for tests. Add port to logging info on connection error
1 parent bf776de commit 8b4155c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pssh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def _connect(self):
100100
raise UnknownHostException("%s - %s" % (str(e.args[1]),
101101
self.host,))
102102
except socket.error, e:
103-
logger.error("Error connecting to host '%s'" % (self.host,))
103+
logger.error("Error connecting to host '%s:%s'" % (self.host,
104+
self.port,))
104105
raise ConnectionErrorException("%s for host '%s:%s'" % (str(e.args[1]),
105106
self.host,
106107
self.port,))

tests/test_pssh_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setUp(self):
1919
def test_pssh_client_exec_command(self):
2020
listen_port = random.randint(1026, 65534)
2121
server = gevent.spawn(listen, { self.fake_cmd : self.fake_resp }, listen_port = listen_port)
22-
gevent.sleep(0)
22+
gevent.sleep(1)
2323
client = ParallelSSHClient(['localhost'], port=listen_port)
2424
cmd = client.exec_command(self.fake_cmd)[0]
2525
output = client.get_stdout(cmd)
@@ -33,7 +33,7 @@ def test_pssh_client_auth_failure(self):
3333
listen_port = random.randint(2048, 65534)
3434
server = gevent.spawn(listen, { self.fake_cmd : self.fake_resp },
3535
listen_port=listen_port, fail_auth=True, )# link_callback=)
36-
gevent.sleep(0)
36+
gevent.sleep(1)
3737
client = ParallelSSHClient(['localhost'], port=listen_port)
3838
cmd = client.exec_command(self.fake_cmd)[0]
3939
# Handle exception

0 commit comments

Comments
 (0)