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

Git worktree cleanup fails on Windows #490

Open
Wuestengecko opened this issue Dec 17, 2024 · 0 comments · May be fixed by #491
Open

Git worktree cleanup fails on Windows #490

Wuestengecko opened this issue Dec 17, 2024 · 0 comments · May be fixed by #491

Comments

@Wuestengecko
Copy link
Member

While cleaning up the Git worktree, this error occurs:

tests/test_filehandler_git.py::test_gitfilehandler_can_read_remote_files_no_revision
  C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\unraisableexception.py:85: PytestUnraisableExceptionWarning: Exception ignored in: <finalize object at 0x258aa768ac0; dead>
  
  Traceback (most recent call last):
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\weakref.py", line 591, in __call__
      return info.func(*info.args, **(info.kwargs or {}))
    File "D:\a\py-capellambse\py-capellambse\capellambse\filehandler\git.py", line 561, in __cleanup_worktree
      subprocess.run(
    File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['git', 'worktree', 'remove', '-f', 'C:\\Users\\runneradmin\\AppData\\Local\\capellambse\\capellambse\\Cache\\worktrees\\capellambse-7004-iu7xk4g9']' returned non-zero exit status 255.
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

Failing to clean up the worktree can lead to excessive disk usage.

Additionally, after fixing this, we should configure pytest to fail if any unraisable exception was detected during a test.

@Wuestengecko Wuestengecko added the bug Something isn't working label Dec 17, 2024
@Wuestengecko Wuestengecko removed the bug Something isn't working label Mar 17, 2025
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

Successfully merging a pull request may close this issue.

1 participant