Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
5dd8ae45
Commit
5dd8ae45
authored
Jul 02, 2015
by
Chris Bednarski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup some resources we may have created
parent
03850caf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
communicator/ssh/communicator.go
communicator/ssh/communicator.go
+6
-0
communicator/ssh/communicator_test.go
communicator/ssh/communicator_test.go
+1
-1
No files found.
communicator/ssh/communicator.go
View file @
5dd8ae45
...
@@ -308,6 +308,12 @@ func (c *comm) reconnect() (err error) {
...
@@ -308,6 +308,12 @@ func (c *comm) reconnect() (err error) {
// We don't need to do anything here. We just want select to block until
// We don't need to do anything here. We just want select to block until
// we connect or timeout.
// we connect or timeout.
case
<-
timeoutExceeded
:
case
<-
timeoutExceeded
:
if
c
.
conn
!=
nil
{
c
.
conn
.
Close
()
}
if
sshConn
!=
nil
{
sshConn
.
Close
()
}
return
ErrHandshakeTimeout
return
ErrHandshakeTimeout
}
}
...
...
communicator/ssh/communicator_test.go
View file @
5dd8ae45
...
@@ -111,8 +111,8 @@ func newMockBrokenServer(t *testing.T) string {
...
@@ -111,8 +111,8 @@ func newMockBrokenServer(t *testing.T) string {
defer
c
.
Close
()
defer
c
.
Close
()
// This should block for a period of time longer than our timeout in
// This should block for a period of time longer than our timeout in
// the test case. That way we invoke a failure scenario.
// the test case. That way we invoke a failure scenario.
time
.
Sleep
(
5
*
time
.
Second
)
t
.
Log
(
"Block on handshaking for SSH connection"
)
t
.
Log
(
"Block on handshaking for SSH connection"
)
time
.
Sleep
(
5
*
time
.
Second
)
}()
}()
return
l
.
Addr
()
.
String
()
return
l
.
Addr
()
.
String
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment