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

Trying to build and unit test on windows eclipse and getting temp file errors #23

Open
mgagp opened this issue Dec 15, 2023 · 1 comment

Comments

@mgagp
Copy link
Contributor

mgagp commented Dec 15, 2023

In GitService.java the basePath = "/tmp";
Running unit test from eclipse 2023.12 using builtin jdk 17 and getting exception.
The gitDirectory is set to "gitrepo".
The cloneRepo method checks if the directory exists and if so, calls FileUtils.deleteDirectory("\tmp\gitrepo");
Down in FileUtils.forceDelete for ".git" there is an exception:
java.nio.file.FileSystemException: \tmp\gitrepo.git\objects\pack\pack-1ea539ee1c45a7d266d014fe2347c06e5d8ab781.pack: The process cannot access the file because it is being used by another process.

What could cause this ?

I would like to contribute to the project, this is why my first step is to make sure I can run the unit tests.

@mgagp
Copy link
Contributor Author

mgagp commented Dec 15, 2023

I have a temporary solution:

public class GitService implements MigrationFilesService{
...
static AtomicInteger seq = new AtomicInteger(0);

public GitService(String localRepo, GitRequest gitRequest) {
    this.gitRequest = gitRequest;
    this.gitDirectory = new File(basePath + "/" + localRepo + Integer.toString(seq.addAndGet(1)));
}

Since the problem is about the repo files being locked for some reason, generating a new repo directory allows the tests to run to the end successfully.

Now, this is obviously not a real solution but at least I can now run the unit tests.

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

1 participant