Skip to content

Commit 367b11f

Browse files
committed
docs(test): add FIXMEs detailing problems with git test run worktree management
1 parent 3b9b417 commit 367b11f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

git-branchless-test/src/lib.rs

+17
Original file line numberDiff line numberDiff line change
@@ -2569,6 +2569,23 @@ fn prepare_working_directory(
25692569
}
25702570
})?;
25712571

2572+
// FIXME: fix locking in the presence of worktrees: if you're using multiple
2573+
// worktrees simultaneously with the `working-copy` strategy, then they all
2574+
// try to acquire `working-copy.lock`, which is wrong. They should be able
2575+
// to acquire locks for their specify working copies. Possibly each worktree
2576+
// should simply have its own lock file in its git dir.
2577+
//
2578+
// FIXME: fix locking in the presence of contention for a single worktree:
2579+
// if you want to run `git test` from the same worktree multiple times
2580+
// concurrently, then you end up trying to lock the same worktrees. It would
2581+
// be a better user experience if we simply created more worktrees or
2582+
// allocated them in a different manner other than by worker ID (which can
2583+
// be the same between concurrent `git test` invocations).
2584+
//
2585+
// FIXME: make worktree acquisition atomic. I got into a situation where one
2586+
// of my worktrees was not correctly provisioned, causing issues only when I
2587+
// happened to try to use that worktree (by using enough concurrency that
2588+
// the worker ID was sufficiently large).
25722589
let lock_file_name = match strategy {
25732590
TestExecutionStrategy::WorkingCopy => "working-copy.lock".to_string(),
25742591
TestExecutionStrategy::Worktree => {

0 commit comments

Comments
 (0)