Skip to content

Commit a6c7dba

Browse files
codexByron
authored andcommitted
test(submodule): close retained parent before checkout removal
The Windows Python 3.14 job for PR #2274 failed in `TestSubmodule.test_base_rw` when forced module-only removal called `rmtree`: Windows reported `WinError 32` for `git/ext/gitdb`. The legacy test retains that checkout's `Repo` through `csm.repo` and starts its persistent `cat-file` process while reading parent commits. Closing only the fresh handle created by `Submodule.remove()` cannot release this caller-owned process. Close the retained test-owned parent before deleting its checkout. Keep strict removal and all existing happy-path assertions, and remove the obsolete commented-out skip that claimed removal ignored this error. The original test predates the PR's base, so record this as a follow-up rather than rewriting shared history. The focused `test_base_rw` passed locally with both CLI and Gix. Relevant pre-commit hooks passed. Hosted Windows validation remains part of the PR CI loop.
1 parent 9ef9ca6 commit a6c7dba

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎test/test_submodule.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,7 @@ def _do_base_tests(self, rwrepo):
13081308

13091309
# Now delete only the module of the main submodule.
13101310
assert sm.module_exists()
1311+
csm.repo.close()
13111312
sm.remove(configuration=False, force=True)
13121313
assert sm.exists()
13131314
assert not sm.module_exists()
@@ -1410,13 +1411,6 @@ def _do_base_tests(self, rwrepo):
14101411
True,
14111412
)
14121413

1413-
# ACTUALLY skipped by git.util.rmtree (in local onerror function), called via
1414-
# git.objects.submodule.base.Submodule.remove at "method(mp)", line 1011.
1415-
#
1416-
# @skipIf(sys.platform == "win32",
1417-
# "FIXME: fails with: PermissionError: [WinError 32] The process cannot access the file because"
1418-
# "it is being used by another process: "
1419-
# "'C:\\Users\\ankostis\\AppData\\Local\\Temp\\tmp95c3z83bnon_bare_test_base_rw\\git\\ext\\gitdb\\gitdb\\ext\\smmap'") # noqa: E501
14201414
@with_rw_repo(k_subm_current)
14211415
def test_base_rw(self, rwrepo):
14221416
self._do_base_tests(rwrepo)

0 commit comments

Comments
 (0)