GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/16116

    [SPARK-18685][TESTS] Fix URI and release resources after opening in tests 
at ExecutorClassLoaderSuite

    ## What changes were proposed in this pull request?
    
    This PR fixes two problems as below:
    
    - Close `BufferedSource` after `Source.fromInputStream(...)` to release 
resource and make the tests pass on Windows in `ExecutorClassLoaderSuite`
    
      ```
      [info] Exception encountered when attempting to run a suite with class 
name: org.apache.spark.repl.ExecutorClassLoaderSuite *** ABORTED *** (7 
seconds, 333 milliseconds)
      [info]   java.io.IOException: Failed to delete: 
C:\projects\spark\target\tmp\spark-77b2f37b-6405-47c4-af1c-4a6a206511f2
      [info]   at 
org.apache.spark.util.Utils$.deleteRecursively(Utils.scala:1010)
      [info]   at 
org.apache.spark.repl.ExecutorClassLoaderSuite.afterAll(ExecutorClassLoaderSuite.scala:76)
      [info]   at 
org.scalatest.BeforeAndAfterAll$class.afterAll(BeforeAndAfterAll.scala:213)
      ...
      ```
    
    
    - Fix URI correctly so that related tests can be passed on Windows.
    
      ```
      [info] - child first *** FAILED *** (78 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ...
      [info] - parent first *** FAILED *** (15 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ...
      [info] - child first can fall back *** FAILED *** (0 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ...
      [info] - child first can fail *** FAILED *** (0 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ...
      [info] - resource from parent *** FAILED *** (0 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ...
      [info] - resources from parent *** FAILED *** (0 milliseconds)
      [info]   java.net.URISyntaxException: Illegal character in authority at 
index 7: 
file://C:\projects\spark\target\tmp\spark-00b66070-0548-463c-b6f3-8965d173da9b
      [info]   at java.net.URI$Parser.fail(URI.java:2848)
      [info]   at java.net.URI$Parser.parseAuthority(URI.java:3186)
      ```
    
    ## How was this patch tested?
    
    Manually tested via AppVeyor.
    
    **Before**
    
https://ci.appveyor.com/project/spark-test/spark/build/102-rpel-ExecutorClassLoaderSuite
    
    **After**
    
https://ci.appveyor.com/project/spark-test/spark/build/108-rpel-ExecutorClassLoaderSuite

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/spark close-after-open

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/16116.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16116
    
----
commit 8d40848fd5559a46561fd9bd3aefac4151d6321d
Author: hyukjinkwon <gurwls...@gmail.com>
Date:   2016-12-02T07:38:01Z

    Fix URI and release resources after opening

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to