-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-18422][CORE] Fix wholeTextFiles test to pass on Windows in JavaAPISuite #15866
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
Conversation
@srowen It seems
And, other some failures specified in the parent JIRA of this seems caused by the problems in Will try to make another PR soon for this. |
Test build #68569 has finished for PR 15866 at commit
|
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.
I'm OK with this, but if the point is to avoid hard-coding "/", is it sufficient to use the File(String, String)
constructor? whatever works and is most consistent with other tests is OK by me. I know they're not that consistent now anyway.
Thank you Sean. Actually, this is a bit annoying. Here is what happened in the original test.
Just FWIW, (at least for myself to note this problem somewhere and re-visit sometime), it seems both back-slash and slash are fine with scala> new File("C:/a")
res9: java.io.File = C:\a
scala> new File("C:\\a", "/part-0000")
res10: java.io.File = C:\a\part-0000 |
Let me add a comment here and will try to clean up more. |
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.
OK I trust your judgment about how best to fix it.
Build started: [CORE] |
Test build #68615 has finished for PR 15866 at commit
|
Looks OK to me @HyukjinKwon but does the appveyor result in your comment above mean that it still fails on Windows? |
Oh, the test this PR tries to deal with, Before
After
FWIW, It seems the root exception for
|
OK if it makes the test in question here pass, let's merge it, as a fix for that test. That much is OK right @HyukjinKwon ? |
Yes please. I am pretty sure that this is a right fix without any other side effects. |
…aAPISuite ## What changes were proposed in this pull request? This PR fixes the test `wholeTextFiles` in `JavaAPISuite.java`. This is failed due to the different path format on Windows. For example, the path in `container` was ``` C:\projects\spark\target\tmp\1478967560189-0/part-00000 ``` whereas `new URI(res._1()).getPath()` was as below: ``` /C:/projects/spark/target/tmp/1478967560189-0/part-00000 ``` ## How was this patch tested? Tests in `JavaAPISuite.java`. Tested via AppVeyor. **Before** Build: https://ci.appveyor.com/project/spark-test/spark/build/63-JavaAPISuite-1 Diff: master...spark-test:JavaAPISuite-1 ``` [info] Test org.apache.spark.JavaAPISuite.wholeTextFiles started [error] Test org.apache.spark.JavaAPISuite.wholeTextFiles failed: java.lang.AssertionError: expected:<spark is easy to use. [error] > but was:<null>, took 0.578 sec [error] at org.apache.spark.JavaAPISuite.wholeTextFiles(JavaAPISuite.java:1089) ... ``` **After** Build started: [CORE] `org.apache.spark.JavaAPISuite` [](https://ci.appveyor.com/project/spark-test/spark/branch/198DDA52-F201-4D2B-BE2F-244E0C1725B2) Diff: master...spark-test:198DDA52-F201-4D2B-BE2F-244E0C1725B2 ``` [info] Test org.apache.spark.JavaAPISuite.wholeTextFiles started ... ``` Author: hyukjinkwon <gurwls223@gmail.com> Closes #15866 from HyukjinKwon/SPARK-18422. (cherry picked from commit 40d59ff) Signed-off-by: Sean Owen <sowen@cloudera.com>
Merged to master/2.1 |
…aAPISuite ## What changes were proposed in this pull request? This PR fixes the test `wholeTextFiles` in `JavaAPISuite.java`. This is failed due to the different path format on Windows. For example, the path in `container` was ``` C:\projects\spark\target\tmp\1478967560189-0/part-00000 ``` whereas `new URI(res._1()).getPath()` was as below: ``` /C:/projects/spark/target/tmp/1478967560189-0/part-00000 ``` ## How was this patch tested? Tests in `JavaAPISuite.java`. Tested via AppVeyor. **Before** Build: https://ci.appveyor.com/project/spark-test/spark/build/63-JavaAPISuite-1 Diff: apache/spark@master...spark-test:JavaAPISuite-1 ``` [info] Test org.apache.spark.JavaAPISuite.wholeTextFiles started [error] Test org.apache.spark.JavaAPISuite.wholeTextFiles failed: java.lang.AssertionError: expected:<spark is easy to use. [error] > but was:<null>, took 0.578 sec [error] at org.apache.spark.JavaAPISuite.wholeTextFiles(JavaAPISuite.java:1089) ... ``` **After** Build started: [CORE] `org.apache.spark.JavaAPISuite` [](https://ci.appveyor.com/project/spark-test/spark/branch/198DDA52-F201-4D2B-BE2F-244E0C1725B2) Diff: apache/spark@master...spark-test:198DDA52-F201-4D2B-BE2F-244E0C1725B2 ``` [info] Test org.apache.spark.JavaAPISuite.wholeTextFiles started ... ``` Author: hyukjinkwon <gurwls223@gmail.com> Closes apache#15866 from HyukjinKwon/SPARK-18422.
What changes were proposed in this pull request?
This PR fixes the test
wholeTextFiles
inJavaAPISuite.java
. This is failed due to the different path format on Windows.For example, the path in
container
waswhereas
new URI(res._1()).getPath()
was as below:How was this patch tested?
Tests in
JavaAPISuite.java
.Tested via AppVeyor.
Before
Build: https://ci.appveyor.com/project/spark-test/spark/build/63-JavaAPISuite-1
Diff: master...spark-test:JavaAPISuite-1
After
Build started: [CORE]
org.apache.spark.JavaAPISuite
Diff: master...spark-test:198DDA52-F201-4D2B-BE2F-244E0C1725B2