Skip to content

Commit 0ed9fae

Browse files
holdenksrowen
authored andcommitted
[SPARK-28886][K8S] Fix the DepsTestsSuite with minikube 1.3.1
### What changes were proposed in this pull request? Matches the response from minikube service against a regex to extract the URL ### Why are the changes needed? minikube 1.3.1 on OSX has different formatting than expected ### Does this PR introduce any user-facing change? No ### How was this patch tested? Ran the existing integration test run on OSX with minikube 1.3.1 Closes apache#25599 from holdenk/SPARK-28886-fix-deps-tests-with-minikube-1.3.1. Authored-by: Holden Karau <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 1f056eb commit 0ed9fae

File tree

1 file changed

+12
-1
lines changed
  • resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest

1 file changed

+12
-1
lines changed

resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/DepsTestsSuite.scala

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,20 @@ private[spark] trait DepsTestsSuite { k8sSuite: KubernetesSuite =>
224224
}
225225

226226
private def getServiceUrl(serviceName: String): String = {
227+
val fuzzyUrlMatcher = """^(.*?)([a-zA-Z]+://.*?)(\s*)$""".r
227228
Eventually.eventually(TIMEOUT, INTERVAL) {
228229
// ns is always available either random or provided by the user
229-
Minikube.minikubeServiceAction(serviceName, "-n", kubernetesTestComponents.namespace, "--url")
230+
val rawUrl = Minikube.minikubeServiceAction(
231+
serviceName, "-n", kubernetesTestComponents.namespace, "--url")
232+
val url = rawUrl match {
233+
case fuzzyUrlMatcher(junk, url, extra) =>
234+
logDebug(s"Service url matched junk ${junk} - url ${url} - extra ${extra}")
235+
url
236+
case _ =>
237+
logWarning(s"Response from minikube ${rawUrl} did not match URL regex")
238+
rawUrl
239+
}
240+
url
230241
}
231242
}
232243
}

0 commit comments

Comments
 (0)