Skip to content

Commit

Permalink
Fix test timeout failures in TestDebug/helm
Browse files Browse the repository at this point in the history
- Set deployment timeout to 2 minutes to support tests without pods
- Log commands prior to execution for better timestamp fidelity
  • Loading branch information
briandealwis committed Jan 20, 2021
1 parent 37ed158 commit 475a15a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions integration/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (k *NSKubernetesClient) GetDeployment(depName string) *appsv1.Deployment {
// WaitForDeploymentsToStabilize waits for a list of deployments to become stable.
func (k *NSKubernetesClient) WaitForDeploymentsToStabilize(depNames ...string) {
k.t.Helper()
k.waitForDeploymentsToStabilizeWithTimeout(60*time.Second, depNames...)
k.waitForDeploymentsToStabilizeWithTimeout(2*time.Minute, depNames...)
}

func (k *NSKubernetesClient) waitForDeploymentsToStabilizeWithTimeout(timeout time.Duration, depNames ...string) {
Expand Down Expand Up @@ -313,15 +313,16 @@ func (k *NSKubernetesClient) waitForDeploymentsToStabilizeWithTimeout(timeout ti
// debug is used to print all the details about pods or deployments
func (k *NSKubernetesClient) debug(entities string) {
cmd := exec.Command("kubectl", "-n", k.ns, "get", entities, "-oyaml")
logrus.Warnln(cmd.Args)
out, _ := cmd.CombinedOutput()

logrus.Warnln(cmd.Args)
// Use fmt.Println, not logrus, for prettier output
fmt.Println(string(out))
}

func (k *NSKubernetesClient) printDiskFreeSpace() {
cmd := exec.Command("df", "-h")
logrus.Warnln(cmd.Args)
out, _ := cmd.CombinedOutput()
fmt.Println(string(out))
}
Expand Down

0 comments on commit 475a15a

Please sign in to comment.