-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-26507][CORE] Fix core tests for Java 11 #23419
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -761,13 +761,13 @@ private[spark] object JsonProtocolSuite extends Assertions { | |
| } | ||
|
|
||
| private def assertJsonStringEquals(expected: String, actual: String, metadata: String) { | ||
| val expectedJson = pretty(parse(expected)) | ||
| val actualJson = pretty(parse(actual)) | ||
| val expectedJson = parse(expected) | ||
| val actualJson = parse(actual) | ||
| if (expectedJson != actualJson) { | ||
| // scalastyle:off | ||
| // This prints something useful if the JSON strings don't match | ||
| println("=== EXPECTED ===\n" + expectedJson + "\n") | ||
| println("=== ACTUAL ===\n" + actualJson + "\n") | ||
| println(s"=== EXPECTED ===\n${pretty(expectedJson)}\n") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation of |
||
| println(s"=== ACTUAL ===\n${pretty(actualJson)}\n") | ||
| // scalastyle:on | ||
| throw new TestFailedException(s"$metadata JSON did not equal", 1) | ||
| } | ||
|
|
@@ -807,7 +807,13 @@ private[spark] object JsonProtocolSuite extends Assertions { | |
| } | ||
|
|
||
| private def assertStackTraceElementEquals(ste1: StackTraceElement, ste2: StackTraceElement) { | ||
| assert(ste1 === ste2) | ||
| // This mimics the equals() method from Java 8 and earlier. Java 9 adds checks for | ||
| // class loader and module, which will cause them to be not equal, when we don't | ||
| // care about those | ||
| assert(ste1.getClassName === ste2.getClassName) | ||
| assert(ste1.getMethodName === ste2.getMethodName) | ||
| assert(ste1.getLineNumber === ste2.getLineNumber) | ||
| assert(ste1.getFileName === ste2.getFileName) | ||
| } | ||
|
|
||
| /** ----------------------------------- * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,7 +158,7 @@ public void testPySparkLauncher() throws Exception { | |
|
|
||
| Map<String, String> env = new HashMap<>(); | ||
| List<String> cmd = buildCommand(sparkSubmitArgs, env); | ||
| assertEquals("python", cmd.get(cmd.size() - 1)); | ||
| assertTrue(Arrays.asList("python", "python2", "python3").contains(cmd.get(cmd.size() - 1))); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also not strictly related, but something I caught while debugging. The Pyspark python interpreter might legitimately be set to a few other values. |
||
| assertEquals( | ||
| String.format("\"%s\" \"foo\" \"%s\" \"bar\" \"%s\"", | ||
| parser.MASTER, parser.DEPLOY_MODE, SparkSubmitCommandBuilder.PYSPARK_SHELL_RESOURCE), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2060,6 +2060,8 @@ | |
| </executions> | ||
| <configuration> | ||
| <scalaVersion>${scala.version}</scalaVersion> | ||
| <checkMultipleScalaVersions>true</checkMultipleScalaVersions> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also not strictly related, but helpful when I was debugging another Java 11 issue. |
||
| <failOnMultipleScalaVersions>true</failOnMultipleScalaVersions> | ||
| <recompileMode>incremental</recompileMode> | ||
| <useZincServer>true</useZincServer> | ||
| <args> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually just cleaning up a deprecation warning along the way; not strictly required for Java 11