Skip to content

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Jan 7, 2026

Problem

The test_list_full_working_tree_conflicts test was failing on macOS CI with the following symptom:

  • Expected: Status column shows (WouldConflict)
  • Actual: Status column shows (Behind)

The test writes an uncommitted file and immediately runs wt list --full, which internally runs git status --porcelain to check if the working tree is dirty before running conflict detection.

Root Cause

This is a known "racy git" issue where git compares file mtimes with the index mtime. If a file is modified within the same filesystem time resolution window as the previous git operation, git status may not detect the change.

macOS filesystems (especially in CI) can have this issue more frequently than Linux due to timing and filesystem characteristics.

Solution

Add a 10ms sleep after writing the uncommitted file, before running wt list --full. This ensures git sees the modification.

This approach is consistent with similar sleeps used elsewhere in the test suite for timing-sensitive operations.

Testing

  • ✅ Test passes on Linux (before and after fix)
  • ⏳ Waiting for macOS CI to verify fix

Related

This is an automated fix for human review.

The test_list_full_working_tree_conflicts test was failing on macOS CI due
to a racy git index issue. When a file is written and immediately followed
by `git status --porcelain`, git may not detect the change if the mtime
falls within the same filesystem time resolution window as the previous
operation.

This is a known "racy git" issue where git compares file mtimes with the
index mtime. On macOS (especially in CI), the filesystem time resolution
can cause git to miss changes that happen too quickly.

Solution: Add a 10ms sleep after writing the file to ensure git status
sees the modification. This is consistent with similar sleeps used in
other tests for background operations.

Fixes test failure: test_list_full_working_tree_conflicts
Related CI run: https://github.com/max-sixty/worktrunk/actions/runs/20766615917

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@max-sixty max-sixty enabled auto-merge (squash) January 7, 2026 00:51
@max-sixty max-sixty merged commit ca0d27f into main Jan 7, 2026
19 checks passed
@max-sixty max-sixty deleted the fix/ci-20766615917 branch January 7, 2026 00:54
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