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
83dd9101
Commit
83dd9101
authored
May 16, 2016
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a timeout to the node e2e Ginkgo test runner
Also add a few debugging statements to indicate progress.
parent
11cd07ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
known-flags.txt
hack/verify-flags/known-flags.txt
+1
-0
e2e_remote.go
test/e2e_node/e2e_remote.go
+5
-1
No files found.
hack/verify-flags/known-flags.txt
View file @
83dd9101
...
@@ -416,6 +416,7 @@ system-reserved
...
@@ -416,6 +416,7 @@ system-reserved
target-port
target-port
tcp-services
tcp-services
terminated-pod-gc-threshold
terminated-pod-gc-threshold
test-timeout
tls-cert-file
tls-cert-file
tls-private-key-file
tls-private-key-file
to-version
to-version
...
...
test/e2e_node/e2e_remote.go
View file @
83dd9101
...
@@ -32,6 +32,7 @@ import (
...
@@ -32,6 +32,7 @@ import (
var
sshOptions
=
flag
.
String
(
"ssh-options"
,
""
,
"Commandline options passed to ssh."
)
var
sshOptions
=
flag
.
String
(
"ssh-options"
,
""
,
"Commandline options passed to ssh."
)
var
sshEnv
=
flag
.
String
(
"ssh-env"
,
""
,
"Use predefined ssh options for environment. Options: gce"
)
var
sshEnv
=
flag
.
String
(
"ssh-env"
,
""
,
"Use predefined ssh options for environment. Options: gce"
)
var
testTimeoutSeconds
=
flag
.
Int
(
"test-timeout"
,
45
*
60
,
"How long (in seconds) to wait for ginkgo tests to complete."
)
var
sshOptionsMap
map
[
string
]
string
var
sshOptionsMap
map
[
string
]
string
...
@@ -120,6 +121,7 @@ func CreateTestArchive() string {
...
@@ -120,6 +121,7 @@ func CreateTestArchive() string {
// RunRemote copies the archive file to a /tmp file on host, unpacks it, and runs the e2e_node.test
// RunRemote copies the archive file to a /tmp file on host, unpacks it, and runs the e2e_node.test
func
RunRemote
(
archive
string
,
host
string
,
cleanup
bool
)
(
string
,
error
)
{
func
RunRemote
(
archive
string
,
host
string
,
cleanup
bool
)
(
string
,
error
)
{
// Create the temp staging directory
// Create the temp staging directory
glog
.
Infof
(
"Staging test binaries on %s"
,
host
)
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
_
,
err
:=
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"mkdir"
,
tmp
)
_
,
err
:=
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"mkdir"
,
tmp
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -149,14 +151,16 @@ func RunRemote(archive string, host string, cleanup bool) (string, error) {
...
@@ -149,14 +151,16 @@ func RunRemote(archive string, host string, cleanup bool) (string, error) {
// No need to log an error if pkill fails since pkill will fail if the commands are not running.
// No need to log an error if pkill fails since pkill will fail if the commands are not running.
// If we are unable to stop existing running k8s processes, we should see messages in the kubelet/apiserver/etcd
// If we are unable to stop existing running k8s processes, we should see messages in the kubelet/apiserver/etcd
// logs about failing to bind the required ports.
// logs about failing to bind the required ports.
glog
.
Infof
(
"Killing any existing node processes on %s"
,
host
)
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"sh"
,
"-c"
,
cmd
)
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"sh"
,
"-c"
,
cmd
)
// Extract the archive and run the tests
// Extract the archive and run the tests
cmd
=
getSshCommand
(
" && "
,
cmd
=
getSshCommand
(
" && "
,
fmt
.
Sprintf
(
"cd %s"
,
tmp
),
fmt
.
Sprintf
(
"cd %s"
,
tmp
),
fmt
.
Sprintf
(
"tar -xzvf ./%s"
,
archiveName
),
fmt
.
Sprintf
(
"tar -xzvf ./%s"
,
archiveName
),
fmt
.
Sprintf
(
"
./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s"
,
cleanup
,
host
),
fmt
.
Sprintf
(
"
timeout -k 30s %ds ./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s"
,
*
testTimeoutSeconds
,
cleanup
,
host
),
)
)
glog
.
Infof
(
"Starting tests on %s"
,
host
)
output
,
err
:=
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"sh"
,
"-c"
,
cmd
)
output
,
err
:=
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"sh"
,
"-c"
,
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
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