diff --git a/hack/jenkins/linux_integration_tests_kvm.sh b/hack/jenkins/linux_integration_tests_kvm.sh index 42c3f43f23..e9df5eab4f 100755 --- a/hack/jenkins/linux_integration_tests_kvm.sh +++ b/hack/jenkins/linux_integration_tests_kvm.sh @@ -28,7 +28,7 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="kvm2" JOB_NAME="Linux-KVM" -PARALLEL_COUNT=3 +PARALLEL_COUNT=4 # Download files and set permissions source ./common.sh diff --git a/hack/jenkins/linux_integration_tests_virtualbox.sh b/hack/jenkins/linux_integration_tests_virtualbox.sh index f307a81f86..13ba5ff0cd 100755 --- a/hack/jenkins/linux_integration_tests_virtualbox.sh +++ b/hack/jenkins/linux_integration_tests_virtualbox.sh @@ -28,7 +28,7 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="virtualbox" JOB_NAME="Linux-VirtualBox" -PARALLEL_COUNT=3 +PARALLEL_COUNT=4 # Download files and set permissions source ./common.sh diff --git a/test/integration/containerd_test.go b/test/integration/containerd_test.go index 54f62bc8aa..9e9618d030 100644 --- a/test/integration/containerd_test.go +++ b/test/integration/containerd_test.go @@ -39,8 +39,11 @@ func TestContainerd(t *testing.T) { func testGvisorRestart(t *testing.T) { p := profile(t) - + if toParallel() { + t.Parallel() + } mk := NewMinikubeRunner(t, p, "--wait=false") + defer mk.TearDown(t) stdout, stderr, err := mk.Start("--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock") if err != nil { diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index e3dccf6305..b442498eed 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -35,7 +35,6 @@ func TestDocker(t *testing.T) { if toParallel() { t.Parallel() } - mk := NewMinikubeRunner(t, p, "--wait=false") defer mk.TearDown(t) diff --git a/test/integration/persistence_test.go b/test/integration/persistence_test.go index eb58a010d0..78821fb4ae 100644 --- a/test/integration/persistence_test.go +++ b/test/integration/persistence_test.go @@ -21,7 +21,6 @@ package integration import ( "path/filepath" "testing" - "time" "github.com/docker/machine/libmachine/state" "k8s.io/minikube/test/integration/util" @@ -56,14 +55,7 @@ func TestPersistence(t *testing.T) { // Make sure everything is up before we stop. verifyBusybox(t) - checkStop := func() error { - stdout, stderr, err = mk.RunCommandRetriable("stop") - return err - } - - if err = util.RetryX(checkStop, 5*time.Second, 3*time.Minute); err != nil { - t.Fatalf("TestPersistence Failed to stop minikube : %v", err) - } + mk.RunCommand("stop", true) mk.CheckStatus(state.Stopped.String()) stdout, stderr, err = mk.Start() diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 8c63b99139..effa95e8fc 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -87,9 +87,6 @@ func TestStartStop(t *testing.T) { } mk.RunCommand("config set WantReportErrorPrompt false", true) - mk.RunCommand("delete", false) - mk.CheckStatus(state.None.String()) - stdout, stderr, err := mk.Start(tc.args...) if err != nil { t.Fatalf("failed to start minikube (for profile %s) failed : %v\nstdout: %s\nstderr: %s", pn, err, stdout, stderr) @@ -103,34 +100,17 @@ func TestStartStop(t *testing.T) { t.Fatalf("IP command returned an invalid address: %s \n %s", ip, stderr) } - // check for the current-context before and after the stop - // TODO: medya move this test to a non-parallel test so we can do more parallel - // kr := util.NewKubectlRunner(t, p) - // currentContext, err := kr.RunCommand([]string{"config", "current-context"}, false) - // if err != nil { - // t.Fatalf("Failed to fetch current-context") - // } - // if strings.TrimRight(string(currentContext), "\n") != p { - // t.Fatalf("got current-context - %q, want current-context %q", string(currentContext), p) - // } - - checkStop := func() error { - mk.RunCommand("stop", true) + stop := func() error { + stdout, stderr, err = mk.RunCommandRetriable("stop") return mk.CheckStatusNoFail(state.Stopped.String()) } - if err := util.Retry(t, checkStop, 10*time.Second, 3); err != nil { - t.Fatalf("timed out while checking stopped status: %v", err) - } + err = util.RetryX(stop, 10*time.Second, 2*time.Minute) + mk.CheckStatus(state.Stopped.String()) - // TODO medyagh: the commented code beollow was not correct ! I leave it for another PR + // TODO medyagh: // https://github.com/kubernetes/minikube/issues/4854 - // running this command results in error when the current-context is not set - // if err := mk.Run("config current-context"); err != nil { - // t.Logf("current-context is not set to minikube") - // } - stdout, stderr, err = mk.Start(tc.args...) if err != nil { t.Fatalf("failed to start minikube (for profile %s) failed : %v\nstdout: %s\nstderr: %s", t.Name(), err, stdout, stderr) diff --git a/test/integration/util/minikube_runner.go b/test/integration/util/minikube_runner.go index a0dde46c1a..1e71d7f522 100644 --- a/test/integration/util/minikube_runner.go +++ b/test/integration/util/minikube_runner.go @@ -242,7 +242,7 @@ func (m *MinikubeRunner) Start(opts ...string) (stdout string, stderr string, er stdout, stderr, err = m.RunCommandRetriable(cmd) return err } - err = RetryX(s, 30*time.Second, m.TimeOutStart) + err = RetryX(s, 10*time.Second, m.TimeOutStart) return stdout, stderr, err } diff --git a/test/integration/version_upgrade_test.go b/test/integration/version_upgrade_test.go index 1d1e691b9a..62a151c8bf 100644 --- a/test/integration/version_upgrade_test.go +++ b/test/integration/version_upgrade_test.go @@ -54,9 +54,7 @@ func fileExists(fname string) error { // and it tries to upgrade from the older supported k8s to news supported k8s func TestVersionUpgrade(t *testing.T) { p := profile(t) - if isTestNoneDriver() { - p = "minikube" - } else { + if toParallel() { t.Parallel() } // fname is the filename for the minikube's latetest binary. this file been pre-downloaded before test by hacks/jenkins/common.sh @@ -65,12 +63,10 @@ func TestVersionUpgrade(t *testing.T) { if err != nil { t.Fail() } + defer os.Remove(fname) mkCurrent := NewMinikubeRunner(t, p) - mkCurrent.RunCommand("delete", true) - mkCurrent.CheckStatus(state.None.String()) - - defer os.Remove(fname) + defer mkCurrent.TearDown(t) mkRelease := NewMinikubeRunner(t, p) mkRelease.BinaryPath = fname @@ -87,9 +83,7 @@ func TestVersionUpgrade(t *testing.T) { // Trim the leading "v" prefix to assert that we handle it properly. stdout, stderr, err = mkCurrent.Start(fmt.Sprintf("--kubernetes-version=%s", strings.TrimPrefix(constants.NewestKubernetesVersion, "v"))) if err != nil { - t.Fatalf("TestVersionUpgrade minikube start failed : %v\nstdout: %s\nstderr: %s", err, stdout, stderr) + t.Fatalf("TestVersionUpgrade mkCurrent.Start start failed : %v\nstdout: %s\nstderr: %s", err, stdout, stderr) } mkCurrent.CheckStatus(state.Running.String()) - mkCurrent.RunCommand("delete", true) - mkCurrent.CheckStatus(state.None.String()) }