Github user JoshRosen commented on the pull request:
https://github.com/apache/spark/pull/3121#issuecomment-62054853
The one subtlety with mixing in `*Data` classes is that the Maven test
runner might instantiate multiple test suites before running any of them, so in
general it's unsafe to create resources that need to be cleaned up in the
constructor of the test suite itself, which is why I'd like to do this setup in
a `beforeAll` method. You can't statically import methods/fields from a `var`,
though, so we can't just instantiate a `*Data` class in `beforeAll` and use it
in all of the tests without having to rewrite every line to access the fields
through the class instance.
One alternative is to have the mixin trait be "resettable" by exposing
`def`s in its public API (basically, what I've proposed above).
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]