fix(test): add sleep to avoid racy git index on macOS #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The
test_list_full_working_tree_conflictstest was failing on macOS CI with the following symptom:✗(WouldConflict)↓(Behind)The test writes an uncommitted file and immediately runs
wt list --full, which internally runsgit status --porcelainto 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 statusmay 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
Related
This is an automated fix for human review.