Skip to content

Commit

Permalink
Incremental improvements to kubelet e2e tests
Browse files Browse the repository at this point in the history
- Add keep-alive to ssh connection
- Don't try to stop services on image-based runs
- Increase jenkins ci timeout to 90 minutes to accomadate unpredictable go build times
- Remove spammy log statement
  • Loading branch information
pwittrock committed Apr 18, 2016
1 parent e5f237a commit 90d2f9a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hack/jenkins/job-configs/kubernetes-jenkins/node-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
- ansicolor:
colormap: xterm
- timeout:
timeout: 45
timeout: 90
fail: true
- timestamps
- inject:
Expand Down
5 changes: 3 additions & 2 deletions test/e2e_node/e2e_node_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ var _ = AfterSuite(func() {
glog.Infof("Stopping node services...")
e2es.stop()
}
glog.Infof("Tests Finished")
})

var _ Reporter = &LogReporter{}
Expand All @@ -91,7 +92,7 @@ type LogReporter struct{}
func (lr *LogReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) {
b := &bytes.Buffer{}
b.WriteString("******************************************************\n")
glog.V(0).Infof(b.String())
glog.Infof(b.String())
}

func (lr *LogReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) {}
Expand All @@ -115,5 +116,5 @@ func (lr *LogReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) {
b.WriteString(fmt.Sprintf("etcd output:\n%s\n", e2es.etcdCombinedOut.String()))
}
b.WriteString("******************************************************\n")
glog.V(0).Infof(b.String())
glog.Infof(b.String())
}
8 changes: 4 additions & 4 deletions test/e2e_node/e2e_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
glog.Fatal(err)
}
sshOptionsMap = map[string]string{
"gce": fmt.Sprintf("-i %s/.ssh/google_compute_engine -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no", usr.HomeDir),
"gce": fmt.Sprintf("-i %s/.ssh/google_compute_engine -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30", usr.HomeDir),
}
}

Expand Down Expand Up @@ -118,14 +118,14 @@ func CreateTestArchive() string {
}

// 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, deleteFiles bool) (string, error) {
func RunRemote(archive string, host string, cleanup bool) (string, error) {
// Create the temp staging directory
tmp := fmt.Sprintf("/tmp/gcloud-e2e-%d", rand.Int31())
_, err := RunSshCommand("ssh", host, "--", "mkdir", tmp)
if err != nil {
return "", err
}
if deleteFiles {
if cleanup {
defer func() {
output, err := RunSshCommand("ssh", host, "--", "rm", "-rf", tmp)
if err != nil {
Expand Down Expand Up @@ -155,7 +155,7 @@ func RunRemote(archive string, host string, deleteFiles bool) (string, error) {
cmd = getSshCommand(" && ",
fmt.Sprintf("cd %s", tmp),
fmt.Sprintf("tar -xzvf ./%s", archiveName),
fmt.Sprintf("./e2e_node.test --logtostderr --v 2 --build-services=false --node-name=%s", host),
fmt.Sprintf("./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s", cleanup, host),
)
output, err := RunSshCommand("ssh", host, "--", "sh", "-c", cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_node/e2e_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (es *e2eService) stop() {
if es.apiServerCmd != nil {
err := es.apiServerCmd.Process.Kill()
if err != nil {
glog.Errorf("Failed to stop be-apiserver.\n%v", err)
glog.Errorf("Failed to stop kube-apiserver.\n%v", err)
}
}
if es.etcdCmd != nil {
Expand Down
2 changes: 0 additions & 2 deletions test/e2e_node/privileged_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"net/url"
"time"

"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
Expand Down Expand Up @@ -151,7 +150,6 @@ func (config *PrivilegedPodTestConfig) dialFromContainer(containerIP string, con
var output map[string]string
err = json.Unmarshal([]byte(stdout), &output)
Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Could not unmarshal curl response: %s", stdout))
glog.Infof("Deserialized output is %v", output)
return output
}

Expand Down

1 comment on commit 90d2f9a

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 21721 outcome was FAILURE
Summary: Execution timeout (new) Build time: 01:00:06

Please sign in to comment.