From 93fcd30b7e6597d05d75dcd12512f8e3493dc4f5 Mon Sep 17 00:00:00 2001 From: ronazhan <65050584+ronazhan@users.noreply.github.com> Date: Wed, 6 Jan 2021 18:03:41 -0800 Subject: [PATCH] [YUNIKORN-496] Add port-forward loop and remove unnecessary test output (#214) * Add a port-forward loop and remove unnecessary test output * Update scheduler core dependencies for the latest --- go.mod | 2 +- go.sum | 2 ++ scripts/run-e2e-tests.sh | 6 ++++-- test/e2e/framework/helpers/k8s/k8s_utils.go | 4 ---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 50c184151..999d746a3 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ go 1.12 require ( github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20200817155620-c19d2b8660d8 - github.com/apache/incubator-yunikorn-core v0.0.0-20201218082332-5471d84cd619 + github.com/apache/incubator-yunikorn-core v0.0.0-20210106054125-dcf631d5c6b5 github.com/apache/incubator-yunikorn-scheduler-interface v0.9.1-0.20201215141356-df4d86d2197b github.com/google/uuid v1.1.1 github.com/looplab/fsm v0.1.0 diff --git a/go.sum b/go.sum index c2bb4943b..dabdda435 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,8 @@ github.com/apache/incubator-yunikorn-core v0.0.0-20201210085111-01f5288eb593 h1: github.com/apache/incubator-yunikorn-core v0.0.0-20201210085111-01f5288eb593/go.mod h1:SDGJNdgVBEfSvbEvP+kci46HzBaFXNLeHcqFQN4zur0= github.com/apache/incubator-yunikorn-core v0.0.0-20201218082332-5471d84cd619 h1:OTtIjML3c9XijNkufiT5AWquCh2TXgtqVjQKIxMqWsY= github.com/apache/incubator-yunikorn-core v0.0.0-20201218082332-5471d84cd619/go.mod h1:d/fn47kdGd094NHiysHAY+0d4evpYRFQ6q5b9eaBONo= +github.com/apache/incubator-yunikorn-core v0.0.0-20210106054125-dcf631d5c6b5 h1:1cDvDjyqKce4U+Zvj7bmPSxU2ok1e+ynJsarFcp+JwQ= +github.com/apache/incubator-yunikorn-core v0.0.0-20210106054125-dcf631d5c6b5/go.mod h1:d/fn47kdGd094NHiysHAY+0d4evpYRFQ6q5b9eaBONo= github.com/apache/incubator-yunikorn-scheduler-interface v0.9.1-0.20200901200728-b9033558f319 h1:I12nCcXdHe6W4oysVejFHfQDy0Ix0r+ZHdfooyEoldo= github.com/apache/incubator-yunikorn-scheduler-interface v0.9.1-0.20200901200728-b9033558f319/go.mod h1:ObMs03XFbnmpGD81jYvdUDEVZbHvz8W6dWH5nGDCjc0= github.com/apache/incubator-yunikorn-scheduler-interface v0.9.1-0.20201215141356-df4d86d2197b h1:dxncLtkTwtqUB6pgsVVw52+Ni3ZXG2BPnLrSrubcRZA= diff --git a/scripts/run-e2e-tests.sh b/scripts/run-e2e-tests.sh index c93cfb673..fe04b662b 100755 --- a/scripts/run-e2e-tests.sh +++ b/scripts/run-e2e-tests.sh @@ -120,8 +120,10 @@ function install_cluster() { kubectl wait --for=condition=ready --timeout=300s pod -l app=yunikorn -n yunikorn exit_on_error "failed to wait for yunikorn scheduler pods being deployed" - # forward rest server port 9080, so the e2e test code can verify cluster state via rest calls - kubectl port-forward svc/yunikorn-service 9080:9080 -n yunikorn & + # forward rest server port 9080 as long as yk ns exists, so the e2e test code can verify cluster state via rest calls. + while kubectl get namespace | grep yunikorn >/dev/null 2>&1; \ + do kubectl port-forward svc/yunikorn-service 9080:9080 -n yunikorn > /dev/null 2>&1; \ + done & exit_on_error "failed to forward rest server port 9080" kubectl describe deployment yunikorn-scheduler -n yunikorn exit_on_error "failed to describe yunikorn scheduler deployment" diff --git a/test/e2e/framework/helpers/k8s/k8s_utils.go b/test/e2e/framework/helpers/k8s/k8s_utils.go index 399a59e17..fb1895ec0 100644 --- a/test/e2e/framework/helpers/k8s/k8s_utils.go +++ b/test/e2e/framework/helpers/k8s/k8s_utils.go @@ -227,8 +227,6 @@ func (k *KubeCtl) DeletePod(podName string, namespace string) error { // currently in desired state func (k *KubeCtl) isPodInDesiredState(podName string, namespace string, state v1.PodPhase) wait.ConditionFunc { return func() (bool, error) { - fmt.Printf(".") // progress bar! - pod, err := k.clientSet.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{}) if err != nil { return false, err @@ -247,8 +245,6 @@ func (k *KubeCtl) isPodInDesiredState(podName string, namespace string, state v1 // Return a condition function that indicates if the pod is NOT in the given namespace func (k *KubeCtl) isPodNotInNS(podName string, namespace string) wait.ConditionFunc { return func() (bool, error) { - fmt.Printf(".") // progress bar! - podNames, err := k.GetPodNamesFromNS(namespace) if err != nil { return false, err