Skip to content

Commit

Permalink
[YUNIKORN-496] Add port-forward loop and remove unnecessary test outp…
Browse files Browse the repository at this point in the history
…ut (#214)

* Add a port-forward loop and remove unnecessary test output
* Update scheduler core dependencies for the latest
  • Loading branch information
ronazhan committed Jan 7, 2021
1 parent 2432d4d commit 93fcd30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 4 additions & 2 deletions scripts/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/framework/helpers/k8s/k8s_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 93fcd30

Please sign in to comment.