-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[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 1 commit
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> | ||
|
|
@@ -2113,7 +2115,7 @@ | |
| <include>**/*Suite.java</include> | ||
| </includes> | ||
| <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory> | ||
| <argLine>-ea -Xmx3g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize}</argLine> | ||
| <argLine>-ea -Xmx6g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize}</argLine> | ||
|
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. Required now to make TimSort tests pass in Java 11, probably because of how direct buffer handling has changed.
Contributor
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. It would be good to know what changed. Do you have an idea?
Member
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. What tests failed?
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 TimSort test failed, where it allocates a very very large array. EDIT: I don't think this is right. See #23419 (comment)
Member
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 % changed is a quite a bit though
Member
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. +1 for increasing this. I also saw multiple TimSort OOM failures even in Apache Spark Jenkins environment(JDK8).
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. @felixcheung Let me try 4G or 5G. I think I just doubled it and it worked so I left it, but may not be necessary to make it that big. |
||
| <environmentVariables> | ||
| <!-- | ||
| Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes | ||
|
|
@@ -2163,7 +2165,7 @@ | |
| <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory> | ||
| <junitxml>.</junitxml> | ||
| <filereports>SparkTestSuite.txt</filereports> | ||
| <argLine>-ea -Xmx3g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize}</argLine> | ||
| <argLine>-ea -Xmx6g -Xss4m -XX:ReservedCodeCacheSize=${CodeCacheSize}</argLine> | ||
| <stderr/> | ||
| <environmentVariables> | ||
| <!-- | ||
|
|
||
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