summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-11-29 13:27:56 -0800
committerJunio C Hamano <gitster@pobox.com>2016-11-29 13:27:56 -0800
commit25e298d2c9f0b4ecd4fc668192a7112e89783d84 (patch)
tree83f05c48e91c366ca52e0cb1093c6a22ef85c9ba
parentbb6bc68d226d3dad2f339fe180ed3f6542fe7649 (diff)
parentfdf4f6c79b4260e98729ebeb208036765595e9ac (diff)
downloadgit-25e298d2c9f0b4ecd4fc668192a7112e89783d84.tar.gz
Merge branch 'as/merge-attr-sleep' into maint
Fix for a racy false-positive test failure. * as/merge-attr-sleep: t6026: clarify the point of "kill $(cat sleep.pid)" t6026: ensure that long-running script really is Revert "t6026-merge-attr: don't fail if sleep exits early" Revert "t6026-merge-attr: ensure that the merge driver was called" t6026-merge-attr: ensure that the merge driver was called t6026-merge-attr: don't fail if sleep exits early
-rwxr-xr-xt/t6026-merge-attr.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
index 7a6e33e673..8f9b48a493 100755
--- a/t/t6026-merge-attr.sh
+++ b/t/t6026-merge-attr.sh
@@ -183,16 +183,24 @@ test_expect_success 'up-to-date merge without common ancestor' '
test_expect_success 'custom merge does not lock index' '
git reset --hard anchor &&
- write_script sleep-one-second.sh <<-\EOF &&
- sleep 1 &
+ write_script sleep-an-hour.sh <<-\EOF &&
+ sleep 3600 &
echo $! >sleep.pid
EOF
- test_when_finished "kill \$(cat sleep.pid)" &&
test_write_lines >.gitattributes \
- "* merge=ours" "text merge=sleep-one-second" &&
+ "* merge=ours" "text merge=sleep-an-hour" &&
test_config merge.ours.driver true &&
- test_config merge.sleep-one-second.driver ./sleep-one-second.sh &&
+ test_config merge.sleep-an-hour.driver ./sleep-an-hour.sh &&
+
+ # We are testing that the custom merge driver does not block
+ # index.lock on Windows due to an inherited file handle.
+ # To ensure that the backgrounded process ran sufficiently
+ # long (and has been started in the first place), we do not
+ # ignore the result of the kill command.
+ # By packaging the command in test_when_finished, we get both
+ # the correctness check and the clean-up.
+ test_when_finished "kill \$(cat sleep.pid)" &&
git merge master
'