You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPARK-21524] [ML] unit test fix: ValidatorParamsSuiteHelpers generates wrong temp files - #18728
ValidatorParamsSuiteHelpers.testFileMove() is generating temp dir in the wrong place and does not delete them.
ValidatorParamsSuiteHelpers.testFileMove() is invoked by TrainValidationSplitSuite and crossValidatorSuite. Currently it uses tempDir from TempDirectory, which unfortunately is never initialized since the boforeAll() of ValidatorParamsSuiteHelpers is never invoked.
In my system, it leaves some temp directories in the assembly folder each time I run the TrainValidationSplitSuite and crossValidatorSuite.
hhbyyh
changed the title
[SPARK-21524] [ML] fix temp dir
[SPARK-21524] [ML] unit test fix: ValidatorParamsSuiteHelpers generates wrong temp files
Jul 24, 2017
Hm, is the more basic error here that object ValidatorParamsSuiteHelpers extends SparkFunSuite ? it seems like it's trying to leverage the temp dir cleanup function in the superclass, but it will never be invoked because this object is never used as an actual test. What about removing both of those superclasses?
Thanks for your attention. @srowen
The temp dir cleanup function is implemented in trait DefaultReadWriteTest which extends TempDirectory, not from SparkFunSuite. And as you said, the beforeAll and afterAll in ValidatorParamsSuiteHelpers was never really triggered. Thus it's creating temp files in the runtime directory and not deleting them.
Removing the SparkFunSuite will cause the === failed in the compareParamMaps function in ValidatorParamsSuiteHelpers. Shall we remove it?
What about only extending, say, FunSuite? there's probably something higher in the hierarchy that would suffice, if all that's really used is ===. Tightening this up a bit might be useful.
Yes, that's good. But I just found there's one rule in the scala style check
"Tests must extend org.apache.spark.SparkFunSuite instead."
try to ignore it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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?
jira: https://issues.apache.org/jira/browse/SPARK-21524
ValidatorParamsSuiteHelpers.testFileMove() is generating temp dir in the wrong place and does not delete them.
ValidatorParamsSuiteHelpers.testFileMove() is invoked by TrainValidationSplitSuite and crossValidatorSuite. Currently it uses
tempDirfromTempDirectory, which unfortunately is never initialized since theboforeAll()ofValidatorParamsSuiteHelpersis never invoked.In my system, it leaves some temp directories in the assembly folder each time I run the TrainValidationSplitSuite and crossValidatorSuite.
How was this patch tested?
unit test fix