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

IOException with pitest-junit5-plugin and junit5 @TempDir #28

Open
simonmarshall opened this issue May 3, 2019 · 5 comments
Open

IOException with pitest-junit5-plugin and junit5 @TempDir #28

simonmarshall opened this issue May 3, 2019 · 5 comments

Comments

@simonmarshall
Copy link

Please find attached pitest-maven.zip containing the following:

  • Class FilePlugin implements Closeable. Its ctor() opens a File file based on the name in config, and its close() method calls file.close(). The ctor() logs the file used.
  • Class FilePluginProvider create() method creates and returns a new FilePlugin constructed with the provided config. The method logs the config used.
  • Class FilePluginProviderTest has a FilePluginProvider provider member and a @TempDir Path folder member. Its single @Test method creates dummy config using a path created from the folder member, and uses try-with-resources to create a FilePlugin with its provider using the config.
  • File pitest-maven.xml containing the effective-pom for plugin pitest-maven.
  • File pitest.log containing the output from a mvn install running pitest.

When I use mvn to run this test normally, the temporary folders are correctly cleaned up by junit5. However, when I run with pitest, folder clean up fails leaving 2 temporary folders behind. Interestingly, the folders that remain are different from the folder that is used for the actual test. The folder created and used by the test, ie, logged by the FileProvider create() method and FilePlugin ctor(), is correctly cleaned up. The folders that are not correctly cleaned up are generated by other mutations that seem not to involve calling the FilePluginProvider create() method.

This happens whether I use 1 thread or many threads for mvn or pitest-maven.

I'm using junit 5.4.2, pitest-junit5-plugin 0.8, pitest-maven 1.4.7.

@hcoles
Copy link
Contributor

hcoles commented May 3, 2019

Thanks for the report. Could you update the zip so it contains a complete pom.xml that reproduces the issue?

@simonmarshall
Copy link
Author

simonmarshall commented May 3, 2019

Hi Henry, with standalone-pom.zip build with mvn clean install -Ppitest -f standalone-pom.xml (I'm using maven 3.5.2 as later versions give us issues)

@hcoles
Copy link
Contributor

hcoles commented May 3, 2019

@simonmarshall I'm afraid it is not possible to reproduce the issue with this pom as it relies on private dependencies.

@simonmarshall
Copy link
Author

Sorry, try with standalone-pom.zip.
Interestingly, with this pom, I can see that the folders that are not deleted are created by the FileProvider create() method and FilePlugin ctor(), because (unlike previously) they appear in the log (included in zip).
However, when I run with the standalone-pom, still folder clean up fails leaving 2 temporary folders behind.

@simonmarshall
Copy link
Author

hi @hcoles - was the latest zip enough for you to reproduce the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants