[PR #605] fix: resolve two remaining flaky tests (LockFile drop + Windows Graphite isolation) #602

Closed
opened 2026-03-02 04:14:05 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/git-ai-project/git-ai/pull/605

State: closed
Merged: Yes


Summary

  • src/utils.rs: Add explicit flock(LOCK_UN) in a #[cfg(unix)] Drop impl for LockFile. The previous implicit unlock (via close() when the File dropped) was unreliable on Linux CI under load, causing test_lockfile_released_on_drop to spuriously fail.

  • tests/graphite.rs: Fully isolate Graphite's data directory per test on all platforms. The gt() helper was setting HOME, XDG_CONFIG_HOME, and LOCALAPPDATA, but not USERPROFILE, XDG_DATA_HOME, or APPDATA. On Windows, Node.js os.homedir() reads USERPROFILE (not HOME), so all parallel tests shared C:\Users\runneradmin\.local\share\graphite\nuxes — a SQLite file Graphite opens exclusively — causing EPERM under concurrent load.

Test plan

  • Ubuntu CI: utils::tests::test_lockfile_released_on_drop passes consistently
  • Windows CI (wrapper): test_gt_create_with_all_flag passes consistently
  • All other tests continue to pass

🤖 Generated with Claude Code


Open with Devin
**Original Pull Request:** https://github.com/git-ai-project/git-ai/pull/605 **State:** closed **Merged:** Yes --- ## Summary - **`src/utils.rs`**: Add explicit `flock(LOCK_UN)` in a `#[cfg(unix)] Drop` impl for `LockFile`. The previous implicit unlock (via `close()` when the `File` dropped) was unreliable on Linux CI under load, causing `test_lockfile_released_on_drop` to spuriously fail. - **`tests/graphite.rs`**: Fully isolate Graphite's data directory per test on all platforms. The `gt()` helper was setting `HOME`, `XDG_CONFIG_HOME`, and `LOCALAPPDATA`, but not `USERPROFILE`, `XDG_DATA_HOME`, or `APPDATA`. On Windows, Node.js `os.homedir()` reads `USERPROFILE` (not `HOME`), so all parallel tests shared `C:\Users\runneradmin\.local\share\graphite\nuxes` — a SQLite file Graphite opens exclusively — causing `EPERM` under concurrent load. ## Test plan - [ ] Ubuntu CI: `utils::tests::test_lockfile_released_on_drop` passes consistently - [ ] Windows CI (wrapper): `test_gt_create_with_all_flag` passes consistently - [ ] All other tests continue to pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/git-ai-project/git-ai/pull/605" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
kerem 2026-03-02 04:14:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#602
No description provided.