Skip to content

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

Conversation

cagliostro92
Copy link
Contributor

image

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 20, 2023
Comment on lines 82 to 83
Path logFile = Files.createTempFile("test-eclipselink-meta", ".log");
LOG_FILE = logFile.toAbsolutePath().toString();
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thank you for the reply. Unfortunately with @TempDir there is the same problem...

@TempDir
static Path TMP;

    @BeforeAll
    static void createLogfile() throws IOException {
        Path logFile = TMP.resolve("test-eclipselink-meta.log");
        LOG_FILE = logFile.toAbsolutePath().toString();
    }

image

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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().

Copy link
Contributor Author

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!

@christophstrobl
Copy link
Member

thank you @EdoardoP92 for bringing this up and taking the time to create a PR.

@cagliostro92
Copy link
Contributor Author

thank you @EdoardoP92 for bringing this up and taking the time to create a PR.

@christophstrobl thank you too

@cagliostro92 cagliostro92 force-pushed the fix-test-filesystemexception branch from 47ef27b to 6c0be21 Compare January 5, 2024 09:13
@pivotal-cla
Copy link

@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.

@mp911de mp911de added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 9, 2024
@cagliostro92 cagliostro92 deleted the fix-test-filesystemexception branch October 29, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants