blob: 84172a3739094adc6cdf6496b016fe68e0b2a771 [file] [log] [blame]
Junio C Hamano29e4d362005-12-20 00:02:15 -08001#!/bin/sh
2
3test_description='racy GIT'
4
Ævar Arnfjörð Bjarmasonc1500642021-10-12 15:56:37 +02005TEST_PASSES_SANITIZE_LEAK=true
Junio C Hamano29e4d362005-12-20 00:02:15 -08006. ./test-lib.sh
7
8# This test can give false success if your machine is sufficiently
9# slow or your trial happened to happen on second boundary.
10
Junio C Hamano407c8eb2005-12-20 12:12:18 -080011for trial in 0 1 2 3 4
Junio C Hamano29e4d362005-12-20 00:02:15 -080012do
Aryan Gupta16050352024-03-05 22:09:17 +000013 test_expect_success "Racy git trial #$trial part A" '
14 rm -f .git/index &&
15 echo frotz >infocom &&
16 git update-index --add infocom &&
17 echo xyzzy >infocom &&
Junio C Hamano29e4d362005-12-20 00:02:15 -080018
Aryan Gupta16050352024-03-05 22:09:17 +000019 git diff-files -p >out &&
20 test_file_not_empty out
21 '
Junio C Hamano407c8eb2005-12-20 12:12:18 -080022 sleep 1
Junio C Hamano407c8eb2005-12-20 12:12:18 -080023
Aryan Gupta16050352024-03-05 22:09:17 +000024 test_expect_success "Racy git trial #$trial part B" '
25 echo xyzzy >cornerstone &&
26 git update-index --add cornerstone &&
Junio C Hamano407c8eb2005-12-20 12:12:18 -080027
Aryan Gupta16050352024-03-05 22:09:17 +000028 git diff-files -p >out &&
29 test_file_not_empty out
30 '
Junio C Hamano29e4d362005-12-20 00:02:15 -080031done
32
33test_done