Skip to content

Commit dec00e6

Browse files
committed
docs(test): add FIXMEs detailing problems with git test run worktree management
1 parent 0dd1ecd commit dec00e6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

git-branchless-test/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,23 @@ fn prepare_working_directory(
25702570
}
25712571
})?;
25722572

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

0 commit comments

Comments
 (0)