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
TempDir diagnostic doesn't output root cause #3236
Comments
TWiStErRob
added a commit
to TWiStErRob/repros
that referenced
this issue
Apr 7, 2023
marcphilipp
added
type: bug
theme: extensions
theme: reporting
component: Jupiter
and removed
3rd-party: Gradle
status: new
java
labels
Apr 16, 2023
marcphilipp
added a commit
that referenced
this issue
Apr 16, 2023
6 tasks
@TWiStErRob Your analysis was spot on. I submitted #3249 to fix it. |
marcphilipp
added a commit
that referenced
this issue
Apr 17, 2023
yhkuo41
pushed a commit
to yhkuo41/junit5
that referenced
this issue
Apr 19, 2023
marcphilipp
added a commit
that referenced
this issue
Apr 22, 2023
Reopening to backport to |
marcphilipp
added a commit
that referenced
this issue
Apr 22, 2023
marcphilipp
added a commit
that referenced
this issue
Apr 22, 2023
Cherry-picked to the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
gradlew test
build\reports\tests\test\index.html
Actual
Click to expand full stack trace, relevant part copied here.
Expected
Mention of the file that doesn't allow deleting the directory, which is actually known at runtime in the context of the failure.
This is an extremely simplified case, I'm trying to debug a huge Gradle build running another one where a file is kept open, so in the test failure it would be very helpful to see the file name as it keeps changing. Also if I was running CI and this happens randomly (flaky test), or just have no access to the file system to check (e.g. GitHub actions) this would be crucial.
Context
Deliverables
The problem is in
java.nio.file.SimpleFileVisitor#resetPermissionsAndTryToDeleteAgain
junit5/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java
Lines 308 to 327 in 8ed3c66
When
notYetRetried
is true, theif
executes. which nicely adorns the exception withaddSuppressed
, but then theexception
is just thrown away.I think if the retry succeeds then it makes sense to not put it in the
failures
, but when it fails the second time it should be:catch (Exception suppressed) { exception.addSuppressed(suppressed); + failures.put(path, exception); }
Beware: the method is called from 2 places, so this might not be viable for both code paths.
The text was updated successfully, but these errors were encountered: