Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump core at beginning and end of node resizes. #20102

Merged
merged 1 commit into from
Jan 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ const (

var (
cloudConfig = &testContext.CloudConfig

reportDir = flag.String("report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
)

func init() {
Expand All @@ -70,6 +68,7 @@ func init() {
flag.StringVar(&testContext.Provider, "provider", "", "The name of the Kubernetes provider (gce, gke, local, vagrant, etc.)")
flag.StringVar(&testContext.KubectlPath, "kubectl-path", "kubectl", "The kubectl binary to use. For development, you might use 'cluster/kubectl.sh' here.")
flag.StringVar(&testContext.OutputDir, "e2e-output-dir", "/tmp", "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.")
flag.StringVar(&testContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
flag.StringVar(&testContext.prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.")

// TODO: Flags per provider? Rename gce-project/gce-zone?
Expand Down Expand Up @@ -98,11 +97,11 @@ func TestE2E(t *testing.T) {
util.ReallyCrash = true
util.InitLogs()
defer util.FlushLogs()
if *reportDir != "" {
if err := os.MkdirAll(*reportDir, 0755); err != nil {
if testContext.ReportDir != "" {
if err := os.MkdirAll(testContext.ReportDir, 0755); err != nil {
glog.Errorf("Failed creating report directory: %v", err)
}
defer CoreDump(*reportDir)
defer CoreDump(testContext.ReportDir)
}

if testContext.Provider == "" {
Expand Down Expand Up @@ -186,8 +185,8 @@ func TestE2E(t *testing.T) {
}
// Run tests through the Ginkgo runner with output to console + JUnit for Jenkins
var r []ginkgo.Reporter
if *reportDir != "" {
r = append(r, reporters.NewJUnitReporter(path.Join(*reportDir, fmt.Sprintf("junit_%02d.xml", config.GinkgoConfig.ParallelNode))))
if testContext.ReportDir != "" {
r = append(r, reporters.NewJUnitReporter(path.Join(testContext.ReportDir, fmt.Sprintf("junit_%02d.xml", config.GinkgoConfig.ParallelNode))))
}
glog.Infof("Starting e2e run; %q", runId)
ginkgo.RunSpecsWithDefaultAndCustomReporters(t, "Kubernetes e2e suite", r)
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/resize_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const (
)

func resizeGroup(size int) error {
if testContext.ReportDir != "" {
CoreDump(testContext.ReportDir)
defer CoreDump(testContext.ReportDir)
Copy link
Member

Choose a reason for hiding this comment

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

does this actually work? or does it immediately call CoreDump when the if block ends?

Copy link
Member

Choose a reason for hiding this comment

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

oh, this is probably OK. I was misreading an example in a for loop.

}
if testContext.Provider == "gce" || testContext.Provider == "gke" {
// TODO: make this hit the compute API directly instead of shelling out to gcloud.
// TODO: make gce/gke implement InstanceGroups, so we can eliminate the per-provider logic
Expand Down
1 change: 1 addition & 0 deletions test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ type TestContextType struct {
CloudConfig CloudConfig
KubectlPath string
OutputDir string
ReportDir string
prefix string
MinStartupPods int
UpgradeTarget string
Expand Down