Commit 958002b
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1093 | 1098 | | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
0 commit comments