[SPARK-33214][TEST][HIVE] Stop HiveExternalCatalogVersionsSuite from using a hard-coded location to store localized Spark binaries. #30122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR changes
HiveExternalCatalogVersionsSuite
to, by default, use a standard temporary directory to store the Spark binaries that it localizes. It additionally adds a new System property,spark.test.cache-dir
, which can be used to define a static location into which the Spark binary will be localized to allow for sharing between test executions. If the System property is used, the downloaded binaries won't be deleted after the test runs.Why are the changes needed?
In SPARK-22356 (PR #19579), the
sparkTestingDir
used byHiveExternalCatalogVersionsSuite
became hard-coded to enable re-use of the downloaded Spark tarball between test executions:However this doesn't work, since it gets deleted every time:
It's bad that we're hard-coding to a
/tmp
directory, as in some cases this is not the proper place to store temporary files. We're not currently making any good use of it.Does this PR introduce any user-facing change?
Developer-facing changes only, as this is in a test.
How was this patch tested?
The test continues to execute as expected.