test: Disable automatic maintenance in remote timeout tests · gitpython-developers/GitPython@958002b · GitHub
Skip to content

Commit 958002b

Browse files
Byroncodex
andcommitted
test: Disable automatic maintenance in remote timeout tests
<!-- agent --> Ubuntu CI reported FileNotFoundError for maintenance.lock while running test_timeout_funcs. The test performs normal pull/fetch calls before its forced timeouts, and Git can launch detached automatic maintenance from those operations. Maintenance can then race with the fixture's recursive removal of the temporary repository, removing a lock file after cleanup has enumerated it. Disable maintenance.auto in this test's temporary repository and set gc.auto to zero for older Git versions that use automatic garbage collection. This removes background housekeeping unrelated to the timeout assertions without weakening repository cleanup or changing library behavior. Use mock.patch.object for the global forced termination status so an assertion failure cannot leak the override into subsequent tests. Validation: Git Trace2 recorded three detached maintenance launches in the original test and none with the fix. The timeout test then passed 20 consecutive runs locally on macOS. Ruff lint and formatting checks and git diff --check passed. The original Ubuntu cleanup exception was not reproduced locally; tracing verified removal of the suspected race source. Assisted-by: GPT 6.0 Co-authored-by: GPT 6.0 <codex@openai.com>
1 parent 415c211 commit 958002b

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

test/test_remote.py

Lines changed: 12 additions & 10 deletions

0 commit comments

Comments
 (0)