Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0acda5ef
Commit
0acda5ef
authored
Aug 22, 2017
by
Andrew McDermott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print root cause failure message in StartTestServerOrDie()
If the server cannot be started then print the underling root cause as opposed to the generic 'Failed to create server chain'.
parent
07dea6b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
testserver.go
cmd/kube-apiserver/app/testing/testserver.go
+8
-2
No files found.
cmd/kube-apiserver/app/testing/testserver.go
View file @
0acda5ef
...
@@ -128,8 +128,14 @@ func StartTestServerOrDie(t *testing.T) (*restclient.Config, TearDownFunc) {
...
@@ -128,8 +128,14 @@ func StartTestServerOrDie(t *testing.T) (*restclient.Config, TearDownFunc) {
// retry test because the bind might fail due to a race with another process
// retry test because the bind might fail due to a race with another process
// binding to the port. We cannot listen to :0 (then the kernel would give us
// binding to the port. We cannot listen to :0 (then the kernel would give us
// a port which is free for sure), so we need this workaround.
// a port which is free for sure), so we need this workaround.
var
err
error
for
retry
:=
0
;
retry
<
5
&&
!
t
.
Failed
();
retry
++
{
for
retry
:=
0
;
retry
<
5
&&
!
t
.
Failed
();
retry
++
{
config
,
td
,
err
:=
StartTestServer
(
t
)
var
config
*
restclient
.
Config
var
td
TearDownFunc
config
,
td
,
err
=
StartTestServer
(
t
)
if
err
==
nil
{
if
err
==
nil
{
return
config
,
td
return
config
,
td
}
}
...
@@ -139,7 +145,7 @@ func StartTestServerOrDie(t *testing.T) (*restclient.Config, TearDownFunc) {
...
@@ -139,7 +145,7 @@ func StartTestServerOrDie(t *testing.T) (*restclient.Config, TearDownFunc) {
t
.
Logf
(
"Bind error, retrying..."
)
t
.
Logf
(
"Bind error, retrying..."
)
}
}
t
.
Fatalf
(
"Failed to launch server
"
)
t
.
Fatalf
(
"Failed to launch server
: %v"
,
err
)
return
nil
,
nil
return
nil
,
nil
}
}
...
...
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