You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by tone-zhang <gi...@git.apache.org> on 2016/08/31 10:34:30 UTC
[GitHub] spark pull request #14894: [SPARK-17330] [SPARK UT] Fix the failure Spark UT...
GitHub user tone-zhang opened a pull request:
https://github.com/apache/spark/pull/14894
[SPARK-17330] [SPARK UT] Fix the failure Spark UT (SPARK-8368) case
## What changes were proposed in this pull request?
Check the database warehouse used in Spark UT, and remove the existing database file before run the UT (SPARK-8368).
## How was this patch tested?
Run Spark UT with the command for several times:
./build/sbt -Pyarn -Phadoop-2.6 -Phive -Phive-thriftserver "test-only *HiveSparkSubmitSuit*"
Without the patch, the test case can be passed only at the first time, and always failed from the second time.
With the patch the test case always can be passed correctly.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tone-zhang/spark issue1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14894.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 #14894
----
commit b85db0658012d3c1bc88a6adc76a6aac70cefdd3
Author: tone-zhang <to...@linaro.org>
Date: 2016-08-31T10:21:20Z
[SPARK-17330] Fix the failure Spark UT (SPARK-8368) case
When run Spark UT based on the latest version of master branch,
the UT case (SPARK-8368) can be passed at the first time, but
always fail if run it again.
The failure reason is the test database file has been existed
before run the case.
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Fix the failure Spark UT (SPARK...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14894
Can one of the admins verify this patch?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on the issue:
https://github.com/apache/spark/pull/14894
@srowen I checked DDLSuite.scala, the case "Create Database using Default Warehouse Path" is used to test the default "spark-warehouse" setting. In the doc, the default path should be "("user.dir")/spark-warehouse". I prefer to keep the path, just remove it after finish the case manually.
For the "tempDir" in DDLSuit.scala, I confirm it is point to the temporary path. It is safe enough.
When check the cases in DDLSuite.scala, I found the "spark-warehouse" is always created by the UT frame. At the final, the directory is empty and it will not negative impact on the UT. I tried to set the WAREHOUSE_PATH of SQLConf to redirect to the temporary path, but failed. May I delete the "spark-warehouse" in function afterEach()? Or could you please give me some suggestion? Thanks a lot!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse...
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14894#discussion_r77164847
--- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
@@ -109,6 +109,8 @@ class HiveSparkSubmitSuite
}
test("SPARK-8368: includes jars passed in through --jars") {
+ val warehousePath = System.getProperty("user.dir") + "/../../spark-warehouse"
--- End diff --
This seems like a bandaid. Where is this directory created and not cleaned up in the first place? I see other tests that create it, so, it's probably best to fix the source?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Fix the failure Spark UT (SPARK...
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on the issue:
https://github.com/apache/spark/pull/14894
@srowen Thanks for the comments.
I wrote SPARK-8368 here just because the UT case name is "SPARK-8368: includes jars passed in through --jars".
For the Utils method you mentioned, could you please share me more hints? Do you mean I just need to remove "spark-warehouse" from .gitignore? If it is, I will have a try, and update the PR.
Thanks a lot!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/14894
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on the issue:
https://github.com/apache/spark/pull/14894
Update the PR to clean up the "spark-warehouse" in DDLSuite.scala.
@srowen I have run the whole Spark UT with the PR, I cannot see "spark/spark-warehoues" after the test. It seems reaches the goal.
Could you please have a review? Thanks a lot!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14894
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/65205/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on the issue:
https://github.com/apache/spark/pull/14894
In Spark UT, the temporary data file should be stored in spark/target/tmp not in spark/spark-warehouse. The Spark UT suite will clean up the path spark/target/tmp when finish the test. It is the existing mechanism.
In some test cases, the property "spark.sql.warehouse.dir" of SQLConf is not set, as default, the spark/spark-warehouse will be used to store the temporary data file, it is in correct.
@srowen Thanks a lot for your comments. Could you please have a review? Thanks!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14894
**[Test build #65205 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/65205/consoleFull)** for PR 14894 at commit [`cd8e9a4`](https://github.com/apache/spark/commit/cd8e9a4ddf704f2d01df870cc898af53e62a9d2f).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse...
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on a diff in the pull request:
https://github.com/apache/spark/pull/14894#discussion_r77448364
--- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
@@ -109,6 +109,8 @@ class HiveSparkSubmitSuite
}
test("SPARK-8368: includes jars passed in through --jars") {
+ val warehousePath = System.getProperty("user.dir") + "/../../spark-warehouse"
--- End diff --
@srowen Thanks a lot for your help!
Yes, it is better to clean up the temporary path at the source. I will have a check and update the PR.
Thanks!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
Merged to master
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14894
**[Test build #65205 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/65205/consoleFull)** for PR 14894 at commit [`cd8e9a4`](https://github.com/apache/spark/commit/cd8e9a4ddf704f2d01df870cc898af53e62a9d2f).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
Yes, I think it wouldn't hurt to always try to delete the default spark-warehouse in this suite after each test. Try running all tests after you're done to see if anything leaves it behind; the goal is to get rid of the entry in gitignore.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
Jenkins test this please
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by tone-zhang <gi...@git.apache.org>.
Github user tone-zhang commented on the issue:
https://github.com/apache/spark/pull/14894
@srowen Thanks a lot for your help.
I have updated the code and used the Utils.deleteRecursively, the Utils method is very helpful. Thanks!
For the time being, I found the UT case is the only one which is impacted.
I will update the title in Jira for #17330, and remove the link in *8368*.
For the updated code, could you please have a review?
Thanks a lot!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Fix the failure Spark UT (SPARK...
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
OK, but the change isn't actually related to SPARK-8368, so I think you can remove that link in the title and the link that was created in the JIRA.
See `Utils.deleteRecursively`. You don't need to implement it yourself.
No, I'm saying that _if_ you find all instances of tests that don't clean up spark-warehouse (there may be more, and we should try to fix all of them), then there's also no reason to have to ignore it in git. But that's not the fix, just a cleanup.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14894
Merged build finished. Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
I'm OK with this as minor cleanup. It can't hurt.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Clean up spark-warehouse in UT
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
This is better. It looks like `DDLSuite` tests the default location which is `./spark-warehouse` in "Create Database using Default Warehouse Path". That's fine but it fails to clean up the directory. I think it needs to clean up there too. You can see that elsewhere it uses this `withTempDir { tempDir =>` idiom to correctly set this to a temp dir.
Although I agree with your changes, aren't there other places in the same file that need the same treatment?
Ultimately the goal is to see that after a successful test run, no `spark-warehouse` exists. If that's true then we can remove it from `.gitignore` and `.rat-excludes`. CC @liancheng re: https://github.com/apache/spark/commit/63db2bd283a430971d85f2a7b06dac77723c56fa
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14894: [SPARK-17330] [SPARK UT] Fix the failure Spark UT (SPARK...
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/14894
How would this relate to SPARK-8368?
We already have a Utils method for deleting recursively already; please use that.
Is this the only path that leaves behind spark-warehouse?
If it's definitely cleaned up we should remove it from .gitignore
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org