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

TemporaryFolder doesn't work for parallel test execution in several JVMs #1223

Closed
tryge opened this issue Nov 24, 2015 · 2 comments
Closed
Milestone

Comments

@tryge
Copy link

tryge commented Nov 24, 2015

Our observation is that the TemporaryFolder is deleted during tests when we run our gradle build with the --parallel flag.

We have several thousand unit tests that in part run in parallel in several JVMs (spawned by gradle). What I think happens is that when junit retrieves a temporary file and deletes it in order to create a directory instead using the same name, between the point where the file is deleted and the directory is created another test in another JVM chooses the same name for the temporary folder. The first test to finish execution deletes the whole directory and the second throws an exception because the directory (or a file in it) doesn't exist anymore.

One option for us is to switch to Files.createTempDirectory, but I like how TemporaryFolder works so I'm in favour of keeping it (and not changing all of our tests...)

@marcphilipp
Copy link
Member

This issue has been addressed in #1304.

asfgit pushed a commit to apache/phoenix that referenced this issue Sep 6, 2017
Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark
tests. Need to disable parallel execution until JUnit 4.13 is
released (junit-team/junit4#1223)
asfgit pushed a commit to apache/phoenix that referenced this issue Sep 6, 2017
Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark
tests. Need to disable parallel execution until JUnit 4.13 is
released (junit-team/junit4#1223)
asfgit pushed a commit to apache/phoenix that referenced this issue Sep 6, 2017
Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark
tests. Need to disable parallel execution until JUnit 4.13 is
released (junit-team/junit4#1223)
asfgit pushed a commit to apache/phoenix that referenced this issue Sep 6, 2017
Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark
tests. Need to disable parallel execution until JUnit 4.13 is
released (junit-team/junit4#1223)
@jzgithub1
Copy link

Was this issue every fixed for certain?

cloudera-hudson pushed a commit to cloudera/phoenix that referenced this issue Aug 1, 2019
Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark
tests. Need to disable parallel execution until JUnit 4.13 is
released (junit-team/junit4#1223)
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

3 participants