Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

test: print pod logs when errors occur #274

Merged
merged 5 commits into from
Jan 12, 2019

Conversation

jackfrancis
Copy link
Member

Reason for Change:

To help debug flakes (e.g., kubectl top nodes), we should be printing out the pod logs when errors occur)

Issue Fixed:

Requirements:

Notes:

@codecov
Copy link

codecov bot commented Jan 10, 2019

Codecov Report

Merging #274 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #274      +/-   ##
==========================================
- Coverage   53.21%   53.16%   -0.05%     
==========================================
  Files          95       95              
  Lines       14235    14244       +9     
==========================================
- Hits         7575     7573       -2     
- Misses       5995     6006      +11     
  Partials      665      665

@@ -612,6 +612,12 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
}
if i > 28 {
log.Printf("Error while running kubectl top nodes:%s\n", err)
pods, err := pod.GetAllByPrefix("metrics-server", "kube-system")
Expect(err).NotTo(HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

I would argue we shouldn't return an error for logging debugging data in this "if not successful" block since that will hide the important error which is Expect(success).To(BeTrue()) on line 624. The logs are bonus, not part of the actual test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good feedback, addressed.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot acs-bot added the lgtm label Jan 12, 2019
@acs-bot
Copy link

acs-bot commented Jan 12, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CecileRobertMichon,jackfrancis]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acs-bot acs-bot merged commit f1c6372 into Azure:master Jan 12, 2019
juhacket pushed a commit to juhacket/aks-engine that referenced this pull request Mar 14, 2019
* test: print pod logs in error conditions

* test: need to get metrics-server pod by prefix

* test: print pod logs for all WaitOnReady errs

* test: return real error if print pod logs fails

* test: don’t error on fetching metrics pod
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants