aboutsummaryrefslogtreecommitdiffstats
path: root/t/t0610-reftable-basics.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0610-reftable-basics.sh')
-rwxr-xr-xt/t0610-reftable-basics.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
index 37510c2b2a..62da3e3782 100755
--- a/t/t0610-reftable-basics.sh
+++ b/t/t0610-reftable-basics.sh
@@ -423,6 +423,33 @@ test_expect_success 'ref transaction: fails gracefully when auto compaction fail
)
'
+test_expect_success 'ref transaction: timeout acquiring tables.list lock' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit initial &&
+ >.git/reftable/tables.list.lock &&
+ test_must_fail git update-ref refs/heads/branch HEAD 2>err &&
+ test_grep "cannot lock references" err
+ )
+'
+
+test_expect_success 'ref transaction: retry acquiring tables.list lock' '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit initial &&
+ LOCK=.git/reftable/tables.list.lock &&
+ >$LOCK &&
+ {
+ ( sleep 1 && rm -f $LOCK ) &
+ } &&
+ git -c reftable.lockTimeout=5000 update-ref refs/heads/branch HEAD
+ )
+'
+
test_expect_success 'pack-refs: compacts tables' '
test_when_finished "rm -rf repo" &&
git init repo &&