Skip to content

Commit ac89463

Browse files
committed
Fixed the test using a master url without a scheme
1 parent 2aeaa5f commit ac89463

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

integration-test/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ private[spark] class KubernetesSuite extends FunSuite with BeforeAndAfterAll wit
7171

7272
test("Run SparkPi with a master URL without a scheme.") {
7373
val url = kubernetesTestComponents.kubernetesClient.getMasterUrl
74-
sparkAppConf.set("spark.master", s"k8s://${url.getHost}:${url.getPort}")
74+
val k8sMasterUrl = if (url.getPort < 0) {
75+
s"k8s://${url.getHost}"
76+
} else {
77+
s"k8s://${url.getHost}:${url.getPort}"
78+
}
79+
sparkAppConf.set("spark.master", k8sMasterUrl)
7580
runSparkPiAndVerifyCompletion()
7681
}
7782

@@ -193,7 +198,7 @@ private[spark] class KubernetesSuite extends FunSuite with BeforeAndAfterAll wit
193198
.withLabel("spark-role", "executor")
194199
.list()
195200
.getItems
196-
executorPods.forEach { pod =>
201+
executorPods.asScala.foreach { pod =>
197202
executorPodChecker(pod)
198203
}
199204

0 commit comments

Comments
 (0)