Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-44297][CORE][TESTS] Make ClassLoaderIsolationSuite test pass with Scala 2.13 #41852

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added core/src/test/resources/TestHelloV2_2.13.jar
Binary file not shown.
Binary file added core/src/test/resources/TestHelloV3_2.13.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,31 @@

package org.apache.spark.executor

import scala.util.Properties

import org.apache.spark.{JobArtifactSet, LocalSparkContext, SparkConf, SparkContext, SparkFunSuite}
import org.apache.spark.util.Utils

class ClassLoaderIsolationSuite extends SparkFunSuite with LocalSparkContext {

private val scalaVersion = Properties.versionNumberString
.split("\\.")
.take(2)
.mkString(".")

val jar1 = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar").toString

// package com.example
// object Hello { def test(): Int = 2 }
// case class Hello(x: Int, y: Int)
val jar2 = Thread.currentThread().getContextClassLoader.getResource("TestHelloV2.jar").toString
val jar2 = Thread.currentThread().getContextClassLoader
.getResource(s"TestHelloV2_$scalaVersion.jar").toString

// package com.example
// object Hello { def test(): Int = 3 }
// case class Hello(x: String)
val jar3 = Thread.currentThread().getContextClassLoader.getResource("TestHelloV3.jar").toString
val jar3 = Thread.currentThread().getContextClassLoader
.getResource(s"TestHelloV3_$scalaVersion.jar").toString

test("Executor classloader isolation with JobArtifactSet") {
sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local"))
Expand Down