Skip to content
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

GEODE-6979: Clean files in ExportLogsStatsDistributedTestBase #3812

Merged
merged 4 commits into from Jul 18, 2019

Conversation

alb3rtobr
Copy link
Contributor

Thank you for submitting a contribution to Apache Geode.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Has your PR been rebased against the latest commit within the target branch (typically develop)?

  • Is your initial contribution a single, squashed commit?

  • Does gradlew build run cleanly?

  • Have you written or updated unit tests to verify your changes?

  • [n/a] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

Note:

Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.

Copy link
Contributor

@jujoramos jujoramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @alb3rtobr!.
Instead of manually removing the files after each test, can you change the test to directly use the TemporaryFolder Rule from JUnit?:

@Rule
public TemporaryFolder tempFolderRule = new TemporaryFolder();

This rule allows creation of files and folders that should be deleted when the test method finishes (whether it passes or fails), so it basically does what we want.
Cheers.

@alb3rtobr
Copy link
Contributor Author

Thanks for the comment, I will add this rule to my "toolbox" XD

@jujoramos
Copy link
Contributor

jujoramos commented Jul 18, 2019

This might be a nit-pick... but I think it's better to use tempFolderRule.getRoot().getAbsolutePath() (or similar) instead of toString() when trying to get the actual String representation of the root folder :-).

@kirklund
Copy link
Contributor

@alb3rtobr @jujoramos If you need to use the TemporaryFolder from multiple DUnit JVMs then you can use the subclass SerializableTemporaryFolder. It'll serialize fine and is then usable from any JVM.

@alb3rtobr
Copy link
Contributor Author

@alb3rtobr @jujoramos If you need to use the TemporaryFolder from multiple DUnit JVMs then you can use the subclass SerializableTemporaryFolder. It'll serialize fine and is then usable from any JVM.

Do you think its needed in these tests? The folder is used to receive the exported logs zip files.

@kirklund
Copy link
Contributor

@alb3rtobr I honestly don't know, but it doesn't hurt anything to change it to SerializableTemporaryFolder. You could just always use the Serializable and Shareable forms of any junit rules (if they exist) in dunit/distributed tests just in case.

@jujoramos jujoramos merged commit 1d3ae3c into apache:develop Jul 18, 2019
@alb3rtobr alb3rtobr deleted the feature/GEODE-6979 branch July 19, 2019 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants