Skip to content

Commit 9926776

Browse files
committed
Integration test tweaks
1 parent 9280509 commit 9926776

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

test/integration/cluster_logs_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ func testClusterLogs(t *testing.T) {
3838
logWords := []string{"minikube", ".go"}
3939
for _, logWord := range logWords {
4040
if !strings.Contains(logsCmdOutput, logWord) {
41+
debugCmds := []string{
42+
"journalctl --verify",
43+
"journalctl",
44+
"systemctl status",
45+
"systemctl status systemd-journald",
46+
}
47+
for _, cmd := range debugCmds {
48+
t.Logf("Command: %s\nOutput: %s", cmd, minikubeRunner.RunCommand(cmd, false))
49+
}
4150
t.Fatalf("Error in logsCmdOutput, expected to find: %s. Output: %s", logWord, logsCmdOutput)
4251
}
4352
}

test/integration/cluster_status_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func testClusterStatus(t *testing.T) {
5252
return nil
5353
}
5454

55-
if err := commonutil.RetryAfter(10, healthy, 1*time.Second); err != nil {
55+
if err := commonutil.RetryAfter(30, healthy, 1*time.Second); err != nil {
5656
t.Fatalf("Cluster is not healthy: %s", err)
5757
}
5858
}

test/integration/persistence_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestPersistence(t *testing.T) {
5757
return &commonutil.RetriableError{Err: fmt.Errorf("Pod %s is not ready yet.", podName)}
5858
}
5959

60-
if err := commonutil.RetryAfter(20, checkPod, 6*time.Second); err != nil {
60+
if err := commonutil.RetryAfter(100, checkPod, 6*time.Second); err != nil {
6161
t.Fatalf("Error checking the status of pod %s. Err: %s", podName, err)
6262
}
6363

@@ -98,7 +98,7 @@ func TestPersistence(t *testing.T) {
9898
minikubeRunner.Start()
9999
minikubeRunner.CheckStatus(state.Running.String())
100100

101-
if err := commonutil.RetryAfter(5, checkPod, 3*time.Second); err != nil {
101+
if err := commonutil.RetryAfter(100, checkPod, 10*time.Second); err != nil {
102102
t.Fatalf("Error checking the status of pod %s. Err: %s", podName, err)
103103
}
104104

test/integration/util/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (m *MinikubeRunner) RunCommand(command string, checkError bool) string {
5959
commandArr := strings.Split(command, " ")
6060
path, _ := filepath.Abs(m.BinaryPath)
6161
cmd := exec.Command(path, commandArr...)
62-
stdout, err := cmd.Output()
62+
stdout, err := cmd.CombinedOutput()
6363

6464
if checkError && err != nil {
6565
if exitError, ok := err.(*exec.ExitError); ok {

0 commit comments

Comments
 (0)