You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f3193ff
Browse filesBrowse the repository at this point in the historyBrowse files
fix: stabilize Windows submodules and temporary test cleanup
On Windows, `git init --separate-git-dir` can try to rename a submodule's
metadata directory onto itself. An open file inside that directory makes
the rename fail with `Directory not empty`, as seen in the CI tutorial.
Close the cloned `Repo` before the shared reconnect helper validates and
repairs its gitfile, releasing retained object handles before Git might need
to initialize or move repository storage.
Add `test.cleanup.cleanup_directory` and `TemporaryDirectory` for disposal
of isolated test directories. Remove whatever is possible, log filesystem
errors, and leave locked files behind without changing the test result.
Retry read-only Windows files and directories without changing symlink or
junction targets. Support both cleanup callback APIs and Python 3.8+.
Migrate test contexts and fixture teardown to these helpers while keeping
`git.util.rmtree`, operations under test, and fixture reuse strict.
Release repository handles before deletion, run the missing performance
test teardown, and wait for the killed Git daemon to exit. Invalidate
cached fixture layouts when disposal fails so subsequent tests rebuild
at fresh paths. Give `test/run-local.py` a private pytest temporary root
to avoid shared-root ownership failures. Remove the diff test's cleanup
xfail and document the test cleanup convention.
Regression coverage includes real Windows file locks, metadata reconnects
through ordinary and 8.3 paths, read-only directories, unchanged symlink
targets, cleanup retries, preserved test-body exceptions, decorator
teardown, and recovery from a locked cached fixture.
Alpine and Ubuntu CI exposed a POSIX daemon leak in the new cleanup test:
`git ls-remote daemon_origin` contacted the previous fixture's server and
failed before the cleanup assertions. Killing the `git daemon` wrapper left
its `git-daemon` child listening with the old base directory. Launch the daemon
executable directly on every platform, extending the existing Windows approach,
so the existing kill-and-wait tears down the server itself. A real socket
regression verifies that the port refuses connections after the context exits.
It fails before this correction; the formerly failing decorator sequence passes
afterward without retries or weakening cleanup assertions.
Validation:
- Windows with Git 2.55.0.windows.5: 164 passed and 1 skipped in the CLI
regression selection; final focused checks passed with 25 passed and
1 skipped for each of the CLI and Gix backends.
- Linux under WSL: 27 passed and 4 skipped in the portable regression
selection.
- Pinned pre-commit hooks, `mypy`, and `basedpyright` passed.
- The daemon/cleanup sequence passed on macOS with Gix first (16 passed,
one Windows-only skip in 2.89 seconds), then CLI (16 passed, one skip in
3.83 seconds). Pinned `pre-commit` hooks, `mypy` and `git diff --check`
passed for this correction.
Copy file name to clipboardExpand all lines: doc/gix-backend.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,11 @@ The prepared environments in this checkout are `.venv` (CLI) and `.tox/gix`
54
54
```
55
55
56
56
The runner uses local version tags, creates an isolated Git configuration,
57
-
prepares the historical test fixture inside a temporary shared clone, and
58
-
disables package-index access. Tests use local repositories, including the
59
-
tutorial example. The suite needs loopback sockets for its Git daemon and
57
+
prepares the historical test fixture inside a temporary shared clone, gives
58
+
pytest a separate temporary root for each run, and disables package-index
59
+
access. Cleanup of these isolated directories is best-effort, so a locked
60
+
leftover cannot change pytest's exit status. Tests use local repositories,
61
+
including the tutorial example. The suite needs loopback sockets for its Git daemon and
60
62
permission to inspect its own child processes. It does not need a remote Git
61
63
server. Missing local tags or packages are errors, not invitations to download.
62
64
@@ -581,7 +583,7 @@ candidates, not proof that a shared fixture is safe in every execution order.
581
583
| --- | --- | --- |
582
584
| 166 |`TExc` (157) and `TestActor` (9) inherit repository-building `TestBase`. | Use the existing `TestCase` base without repository setup. |
583
585
| 182 | Three submodule rejection bodies repeatedly build `movable_submodule`, then check snapshots for no mutation. | Prepare logical-name baselines once and copy the parent per case, retaining fresh wrappers and independent writable files. |
584
-
| 51 | Six submodule rejection bodies prepare nested metadata, separate metadata, intermediate/leaf symlinks, or retained metadata before checking rejection. | Cache ten prepared layouts and restore complete copies at their original paths, preserving absolute Git links and symlinks. Cleanup removes the active copy even after failure. |
586
+
| 51 | Six submodule rejection bodies prepare nested metadata, separate metadata, intermediate/leaf symlinks, or retained metadata before checking rejection. | Cache ten prepared layouts and restore complete copies at their original paths, preserving absolute Git links and symlinks. Cleanup is best-effort; a locked active copy invalidates the layout so the next case rebuilds at a fresh path. |
585
587
| 15 | Eight revision-query bodies rebuild the same four-commit graph, refs, index, and reflogs through `rev_parse_repo`. | Prepare the graph once and copy it for every consumer, including mutating cases; recreate repository, branch and commit wrappers. |
586
588
| 8 | Tree lookup bodies clone and check out `0.3.2.1` through `with_rw_repo`. | Read the historical tree directly through the existing class repository, removing clones and checkouts. |
0 commit comments