-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fixes FileSystemException #3281
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
Fixes FileSystemException #3281
Conversation
Path logFile = Files.createTempFile("test-eclipselink-meta", ".log"); | ||
LOG_FILE = logFile.toAbsolutePath().toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about making use of junits @TempDir
leveraging automatic cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally switching to @TempDir
is generally a good thing but we cannot fix the underlying problem that Eclipselink doesn't close the underlying logger. The offending code is in EntityManagerSetupImpl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mp911de Let me know how I can resolve this issue, if my proposal to use temporary files is ok or if you prefer some other changes. I want to contribute, but I can't check my contribution without run the entire test suite. In the meantime, after further analysis, I can for sure open an issue, or a PR to the EclipseLink project. Thank you very much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing the problem for you leaves us with temp directories that aren't cleaned up. So I think you could explore File.deleteOnExit()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mp911de Added with the latest commit. Thanks!
thank you @EdoardoP92 for bringing this up and taking the time to create a PR. |
@christophstrobl thank you too |
47ef27b
to
6c0be21
Compare
@cagliostro92 Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
Under Windows operating system, unfortunately, I'm unable to build the JPA project because of a FileSystemException thrown at the act of delete the test-eclipselink-meta.log file in the EclipseLinkMetaAnnotatedQueryMethodIntegrationTests class. The proposal is to use a temporary file whose life cycle can be easily managed by the underlying operating system. Thanks in advance to the JPA team.