Skip to content

Conversation

@max-sixty
Copy link
Owner

Fixes CI failure from commit bdf4351 (run 20873663585).

Problem

The test test_list_full_working_tree_conflicts was failing in CI because the WorkingTreeConflictsTask ran before git's index was updated. This caused it to see the working tree as clean even though uncommitted changes existed, resulting in the conflict symbol showing (behind) instead of (conflicts).

Root Cause

The commit bdf4351 introduced timing changes that made a pre-existing race condition more likely to occur. The WorkingTreeConflictsTask checks if the working tree is dirty via git status --porcelain, but without refreshing the index first, this can miss recently modified files due to "racy git" timing issues where file modifications within the same timestamp granularity aren't immediately detected.

Solution

Cherry-picked the fix from commit f815fdf (which was created for a previous similar CI failure) that:

  • Adds git update-index --refresh before checking if the working tree is dirty
  • Implements retry logic (up to 3 attempts with 10ms delays) to handle filesystem timestamp granularity issues
  • Ensures git's index reflects recent file modifications before the status check

This fix was already proven to work in PR #516 (branch fix/ci-20872461469) but hadn't been merged to main yet.

Testing

  • ✅ The failing test test_list_full_working_tree_conflicts now passes
  • ✅ All 1810 tests pass locally
  • ✅ Ready for CI verification

Related

…onflictsTask

Adds `git update-index --refresh` before checking if the working tree is
dirty in `WorkingTreeConflictsTask`. This prevents "racy git" timing issues
where file modifications within the same timestamp granularity may not be
detected as dirty, causing the task to incorrectly return None and fall
back to commit-based conflict detection.

The test `test_list_full_working_tree_conflicts` was failing in CI because
the `WorkingTreeConflictsTask` ran before git's index was updated, causing
it to see the working tree as clean even though uncommitted changes existed.
This resulted in the conflict symbol showing `↓` (behind) instead of `✗`
(conflicts).

The fix ensures git's index is refreshed before the status check. Errors
from update-index are ignored (read-only repos, permission issues) since
git status will still work.

Fixes CI failure in run 20872461469 from commit f372620.

Co-authored-by: Claude Sonnet 4.5 <[email protected]>
@max-sixty max-sixty closed this Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants