Skip to contentSkip to conversation

t0025 flaky on OSX

PATCH Superseded Torsten Bögershausen 4 participants 16 messages Apr 24, 2017 – May 11, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 12 lines · Torsten Bögershausen
Quoted 9 lines · Lars Schneider

Hi,

"t0025.3 - crlf=true causes a CRLF file to be normalized" failed sporadically on next and master recently:
https://travis-ci.org/git/git/jobs/225084459#L2382
https://travis-ci.org/git/git/jobs/223830505#L2342

Are you aware of a race condition in the code
or in the test?

Not yet - I'll have a look

So,
The test failed under Linux & pu of the day, using Peff's stress script.

not ok 3 - crlf=true causes a CRLF file to be normalized

The good case (simplified):

$ git status
   modified:   CRLFonly

Untracked files:
.gitattributes

$ git diff | tr "\015" Q
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
CRLFonly +7 -7
index 44fc21c..666dbf4 100644
@@ -1,7 +1,7 @@
-IQ
-amQ
-veryQ
-veryQ
-fineQ
-thankQ
-youQ
+I
+am
+very
+very
+fine
+thank
+you

--------------------
The failed case:

$ git status
Untracked files:
        .gitattributes

-----------------------

$ ls -al -i
total 28
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3429958 -rw-r--r-- 1 tb tb   37 Apr 24 21:19 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:27 .git
3425599 -rw-r--r-- 1 tb tb   14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb   24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb   36 Apr 24 21:19 LFwithNUL

-----------------
#After

$ mv CRLFonly tmp
$ cp tmp CRLFonly
$ ls -al -i
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:36 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3401599 -rw-r--r-- 1 tb tb   37 Apr 24 21:36 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:36 .git
3425599 -rw-r--r-- 1 tb tb   14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb   24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb   36 Apr 24 21:19 LFwithNUL
3429958 -rw-r--r-- 1 tb tb   37 Apr 24 21:19 tmp
$ git status
	modified:   CRLFonly
Untracked files:
        .gitattributes
        tmp

So all in all it seams as if there is a very old race condition here, which we "never" have seen yet.
Moving the file to a different inode number fixes the test case, Git doesn't treat it as unchanged any more.

#3 lore raw
Quoted 92 lines · Torsten Bögershausen
Quoted 12 lines · Torsten Bögershausen
Quoted 9 lines · Lars Schneider

Hi,

"t0025.3 - crlf=true causes a CRLF file to be normalized" failed sporadically on next and master recently:
https://travis-ci.org/git/git/jobs/225084459#L2382
https://travis-ci.org/git/git/jobs/223830505#L2342

Are you aware of a race condition in the code
or in the test?

Not yet - I'll have a look

So,
The test failed under Linux & pu of the day, using Peff's stress script.

not ok 3 - crlf=true causes a CRLF file to be normalized

The good case (simplified):

$ git status
  modified:   CRLFonly

Untracked files:
.gitattributes

$ git diff | tr "\015" Q
warning: CRLF will be replaced by LF in CRLFonly.
The file will have its original line endings in your working directory.
CRLFonly +7 -8
index 44fc21c..666dbf4 100644
@@ -1,7 +1,7 @@
-IQ
-amQ
-veryQ
-veryQ
-fineQ
-thankQ
-youQ
+I
+am
+very
+very
+fine
+thank
+you
 
--------------------

The failed case:

$ git status
Untracked files:
       .gitattributes

-----------------------

$ ls -al -i
total 28
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3429958 -rw-r--r-- 1 tb tb   37 Apr 24 21:19 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:27 .git
3425599 -rw-r--r-- 1 tb tb   14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb   24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb   36 Apr 24 21:19 LFwithNUL

-----------------
#After

$ mv CRLFonly tmp
$ cp tmp CRLFonly
$ ls -al -i
3430195 drwxr-xr-x 3 tb tb 4096 Apr 24 21:36 .
3427617 drwxr-xr-x 3 tb tb 4096 Apr 24 21:19 ..
3401599 -rw-r--r-- 1 tb tb   37 Apr 24 21:36 CRLFonly
3432574 drwxr-xr-x 8 tb tb 4096 Apr 24 21:36 .git
3425599 -rw-r--r-- 1 tb tb   14 Apr 24 21:19 .gitattributes
3430089 -rw-r--r-- 1 tb tb   24 Apr 24 21:19 LFonly
3430174 -rw-r--r-- 1 tb tb   36 Apr 24 21:19 LFwithNUL
3429958 -rw-r--r-- 1 tb tb   37 Apr 24 21:19 tmp
$ git status
	modified:   CRLFonly
Untracked files:
       .gitattributes
       tmp
Quoted 4 lines

So all in all it seams as if there is a very old race condition here, which we "never" have seen yet.
Moving the file to a different inode number fixes the test case, Git doesn't treat it as unchanged any more.

Thanks a lot for investigating this! Would you mind posting the fix as patch?

Thanks,
Lars

#4 lore raw
Quoted 9 lines
Quoted 6 lines

So all in all it seams as if there is a very old race condition here, which we "never" have seen yet.
Moving the file to a different inode number fixes the test case, Git doesn't treat it as unchanged any more.

Thanks a lot for investigating this! Would you mind posting the fix as patch?

That's ongoing.
TC #3 and #4 are fixable, but #5 resists to be cured so far. I think we need a touch and sleep or so, more the next days (or weeks)

#5 lore raw
Quoted 10 lines · Torsten Bögershausen
Quoted 8 lines
Quoted 7 lines

So all in all it seams as if there is a very old race condition here, which we "never" have seen yet.
Moving the file to a different inode number fixes the test case, Git doesn't treat it as unchanged any more.

Quoted 6 lines
Quoted 2 lines

Thanks a lot for investigating this! Would you mind posting the fix as patch?

That's ongoing.
TC #3 and #4 are fixable, but #5 resists to be cured so far. I think we need a touch and sleep or so, more the next days (or weeks)

Cool! Actually #3 seems to cause most of the trouble. Therefore I think a patch for #3 and #4 would already be valuable!

Thanks,
Lars

#6 lore raw

PATCH 1/1 t0027: Some tests are not expensive

In reply to Torsten Bögershausen

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests from t0025 are covered in t0027 as well, so that t0025 can be retired later.

Split the tests in t0027 into 2 groups: expensive and not expensive. Expensive are all tests which check the CRLF conversion warnings and all tests which activate the Git internal "ident" filter.

All other test are now run under all platforms, which allows to remove the flaky t0025 in the next commit.

The execution time for the non-expansive part is 6..8 seconds under Linux, and 32 seconds under Mac Os X.

Running the "expensive" version roughly doubles the time.

And in case you ask, things are not going significantly faster using a SSD instead of a spinning disk.

PS: The removal of t0025 is not included (yet)

---
 t/t0027-auto-crlf.sh | 100 ++++++++++++++++++++++++++++++---------------------
 1 file changed, 59 insertions(+), 41 deletions(-)
t/t0027-auto-crlf.sh +59 -41
index 90db54c..2c5aff6 100755
@@ -4,10 +4,12 @@ test_description='CRLF conversion all combinations'
 
 . ./test-lib.sh
 
-if ! test_have_prereq EXPENSIVE
+if ! test_have_prereq EXPENSIVE && ! test_have_prereq MINGW
 then
-	skip_all="EXPENSIVE not set"
-	test_done
+	say "# EXPENSIVE or MINGW not set, skipping ident and warning tests"
+else
+	EXPENSIVE0027=t
+	export EXPENSIVE0027
 fi
 
 compare_files () {
@@ -95,11 +97,14 @@ commit_check_warn () {
 		git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
 	done &&
 	git commit -m "core.autocrlf $crlf" &&
-	check_warning "$lfname" ${pfx}_LF.err &&
-	check_warning "$crlfname" ${pfx}_CRLF.err &&
-	check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err &&
-	check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err &&
-	check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+	if test "$EXPENSIVE0027" = t
+	then
+		check_warning "$lfname" ${pfx}_LF.err &&
+		check_warning "$crlfname" ${pfx}_CRLF.err &&
+		check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err &&
+		check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err &&
+		check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+	fi
 }
 
 commit_chk_wrnNNO () {
@@ -122,24 +127,27 @@ commit_chk_wrnNNO () {
 		git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
 	done
 
-	test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
-		check_warning "$lfwarn" ${pfx}_LF.err
-	'
-	test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF" '
-		check_warning "$crlfwarn" ${pfx}_CRLF.err
-	'
-
-	test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_mix_LF" '
-		check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err
-	'
-
-	test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf LF_mix_cr" '
-		check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err
-	'
-
-	test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_nul" '
-		check_warning "$crlfnul" ${pfx}_CRLF_nul.err
-	'
+	if test "$EXPENSIVE0027" = t
+	then
+		test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
+			check_warning "$lfwarn" ${pfx}_LF.err
+		'
+		test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF" '
+			check_warning "$crlfwarn" ${pfx}_CRLF.err
+		'
+
+		test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_mix_LF" '
+			check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err
+		'
+
+		test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf LF_mix_cr" '
+			check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err
+		'
+
+		test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_nul" '
+			check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+		'
+	fi
 }
 
 stats_ascii () {
@@ -250,21 +258,24 @@ checkout_files () {
 		fi
 	done
 
-	test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '
-		test_when_finished "rm expect actual" &&
-		sort <<-EOF >expect &&
-		i/crlf w/$(stats_ascii $crlfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF.txt
-		i/mixed w/$(stats_ascii $lfmixcrlf) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_mix_LF.txt
-		i/lf w/$(stats_ascii $lfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF.txt
-		i/-text w/$(stats_ascii $lfmixcr) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_mix_CR.txt
-		i/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_nul.txt
-		i/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_nul.txt
-		EOF
-		git ls-files --eol crlf_false_attr__* |
-		sed -e "s/	/ /g" -e "s/  */ /g" |
-		sort >actual &&
-		test_cmp expect actual
-	'
+	if test "$EXPENSIVE0027" = t
+	then
+		test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '
+			test_when_finished "rm expect actual" &&
+			sort <<-EOF >expect &&
+			i/crlf w/$(stats_ascii $crlfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF.txt
+			i/mixed w/$(stats_ascii $lfmixcrlf) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_mix_LF.txt
+			i/lf w/$(stats_ascii $lfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF.txt
+			i/-text w/$(stats_ascii $lfmixcr) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_mix_CR.txt
+			i/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF_nul.txt
+			i/-text w/$(stats_ascii $crlfnul) attr/$(attr_ascii $attr $aeol) crlf_false_attr__LF_nul.txt
+			EOF
+			git ls-files --eol crlf_false_attr__* |
+			sed -e "s/	/ /g" -e "s/  */ /g" |
+			sort >actual &&
+			test_cmp expect actual
+		'
+		fi
 	test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=LF" "
 		compare_ws_file $pfx $lfname    crlf_false_attr__LF.txt
 	"
@@ -494,6 +505,13 @@ export CRLF_MIX_LF_CR MIX NL
 # Same handling with and without ident
 for id in "" ident
 do
+	if ! test "$EXPENSIVE0027" = t
+	then
+		if test "$id" = ident
+		then
+			continue
+		fi
+	fi
 	for ceol in lf crlf native
 	do
 		for crlf in true false input
Signature · 1 line
2.10.0
#7 lore raw

Re: [PATCH/RFC 1/1] t0027: Some tests are not expensive

Quoted 6 lines · [email protected] writes:

From: Torsten Bögershausen <[email protected]>
...
The execution time for the non-expansive part is 6..8 seconds under Linux, and 32 seconds under Mac Os X.

Running the "expensive" version roughly doubles the time.

Hmph, perhaps none of these is truly expensive if that is the case? I am not talking about ~10 or ~30 seconds in absolute terms, but reacting to "excluding the ones only halves the time."

The files used in the test vector seem to be all small. Is the expensiveness due to the fact that there are so many of them, and not due to some specific conversion being very slow?

#8 lore raw

Re: [PATCH/RFC 1/1] t0027: Some tests are not expensive

Quoted 9 lines · Junio C Hamano
Quoted 6 lines · [email protected] writes:

From: Torsten Bögershausen <[email protected]>
...
The execution time for the non-expansive part is 6..8 seconds under Linux, and 32 seconds under Mac Os X.

Running the "expensive" version roughly doubles the time.

Quoted 7 lines

Hmph, perhaps none of these is truly expensive if that is the case? I am not talking about ~10 or ~30 seconds in absolute terms, but reacting to "excluding the ones only halves the time."

The files used in the test vector seem to be all small.

Is the expensiveness due to the fact that there are so many of them,

Yes

Quoted 1 line

and not due to some specific conversion being very slow?

Yes

The easiest solution is probably to simply remove the EXPENSIVE precondition from t0027 and run it always on all platforms. At the same time t0025 can be removed.
Unless somebody objects, I will send a V2 the next days.

#9 lore raw

PATCH v2 1/1 t0027: tests are not expensive; remove t0025

In reply to Torsten Bögershausen

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests from t0025 are covered in t0027 already, so that t0025 can be retiered:
The execution time for t0027 is 14 seconds under Linux,
and 63 seconds under Mac Os X.
And in case you ask, things are not going significantly faster using a SSD instead of a spinning disk.

---
 t/t0025-crlf-auto.sh | 181 ---------------------------------------------------
 t/t0027-auto-crlf.sh |   6 --
 2 files changed, 187 deletions(-)
 delete mode 100755 t/t0025-crlf-auto.sh
t/t0025-crlf-auto.sh deleted +0 -181
deleted file mode 100755
index 89826c5..0000000
@@ -1,181 +0,0 @@
-#!/bin/sh
-
-test_description='CRLF conversion'
-
-. ./test-lib.sh
-
-has_cr() {
-	tr '\015' Q <"$1" | grep Q >/dev/null
-}
-
-test_expect_success setup '
-
-	git config core.autocrlf false &&
-
-	for w in Hello world how are you; do echo $w; done >LFonly &&
-	for w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >CRLFonly &&
-	for w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >LFwithNUL &&
-	git add . &&
-
-	git commit -m initial &&
-
-	LFonly=$(git rev-parse HEAD:LFonly) &&
-	CRLFonly=$(git rev-parse HEAD:CRLFonly) &&
-	LFwithNUL=$(git rev-parse HEAD:LFwithNUL) &&
-
-	echo happy.
-'
-
-test_expect_success 'default settings cause no changes' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'crlf=true causes a CRLF file to be normalized' '
-
-	# Backwards compatibility check
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "CRLFonly crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	# Note, "normalized" means that git will normalize it if added
-	has_cr CRLFonly &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	test -n "$CRLFonlydiff"
-'
-
-test_expect_success 'text=true causes a CRLF file to be normalized' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "CRLFonly text" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	# Note, "normalized" means that git will normalize it if added
-	has_cr CRLFonly &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	test -n "$CRLFonlydiff"
-'
-
-test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf false &&
-	echo "LFonly eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf input &&
-	echo "LFonly eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "LFonly eol=lf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'autocrlf=true does not normalize CRLF files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'text=auto, autocrlf=true does not normalize CRLF files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "* text=auto" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "* text=auto" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFwithNUL &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFwithNULdiff"
-'
-
-test_expect_success 'eol=crlf _does_ normalize binary files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "LFwithNUL eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFwithNUL &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFwithNULdiff"
-'
-
-test_expect_success 'prepare unnormalized' '
-	> .gitattributes &&
-	git config core.autocrlf false &&
-	printf "LINEONE\nLINETWO\r\n"     >mixed &&
-	git add mixed .gitattributes &&
-	git commit -m "Add mixed" &&
-	git ls-files --eol | egrep "i/crlf" &&
-	git ls-files --eol | egrep "i/mixed"
-'
-
-test_expect_success 'normalize unnormalized' '
-	echo "* text=auto" >.gitattributes &&
-	rm .git/index &&
-	git add . &&
-	git commit -m "Introduce end-of-line normalization" &&
-	git ls-files --eol | tr "\\t" " " | sort >act &&
-cat >exp <<EOF &&
-i/-text w/-text attr/text=auto         LFwithNUL
-i/lf    w/crlf  attr/text=auto         CRLFonly
-i/lf    w/crlf  attr/text=auto         LFonly
-i/lf    w/lf    attr/text=auto         .gitattributes
-i/lf    w/mixed attr/text=auto         mixed
-EOF
-	test_cmp exp act
-'
-
-test_done
t/t0027-auto-crlf.sh +0 -6
index 90db54c..effc3db 100755
@@ -4,12 +4,6 @@ test_description='CRLF conversion all combinations'
 
 . ./test-lib.sh
 
-if ! test_have_prereq EXPENSIVE
-then
-	skip_all="EXPENSIVE not set"
-	test_done
-fi
-
 compare_files () {
 	tr '\015\000' QN <"$1" >"$1".expect &&
 	tr '\015\000' QN <"$2" | tr -d 'Z' >"$2".actual &&
Signature · 1 line
2.10.0
#10 lore raw

Re: [PATCH v2 1/1] t0027: tests are not expensive; remove t0025

Hi Bögi,

Quoted 11 lines · On Tue, 2 May 2017, [email protected] wrote:

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Indeed.

Quoted 5 lines

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests from t0025 are covered in t0027 already, so that t0025 can be retiered:

s/retiered/retired/

Quoted 6 lines

The execution time for t0027 is 14 seconds under Linux,
and 63 seconds under Mac Os X.
And in case you ask, things are not going significantly faster using a SSD instead of a spinning disk.

Thank you for this patch.

Apart from the tyop, would it be possible to fix the formatting to look less strange? (Unless you use this to transport a super-secret message steganographically to an alien planet or some such, of course.)

Ciao,
Dscho

#11 lore raw

Re: [PATCH v2 1/1] t0027: tests are not expensive; remove t0025

Quoted 13 lines · Johannes Schindelin
Quoted 5 lines

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests from t0025 are covered in t0027 already, so that t0025 can be retiered:

s/retiered/retired/

Quoted 5 lines

The execution time for t0027 is 14 seconds under Linux,
and 63 seconds under Mac Os X.
And in case you ask, things are not going significantly faster using a SSD instead of a spinning disk.

Quoted 7 lines
Quoted 1 line

Thank you for this patch.

Apart from the tyop, would it be possible to fix the formatting to look less strange? (Unless you use this to transport a super-secret message steganographically to an alien planet or some such, of course.)

Ping?

Thanks.

#12 lore raw

Re: [PATCH v2 1/1] t0027: tests are not expensive; remove t0025

Quoted 17 lines · Junio C Hamano
Quoted 15 lines · Johannes Schindelin
Quoted 5 lines

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests from t0025 are covered in t0027 already, so that t0025 can be retiered:

s/retiered/retired/

Quoted 6 lines

The execution time for t0027 is 14 seconds under Linux,
and 63 seconds under Mac Os X.
And in case you ask, things are not going significantly faster using a SSD instead of a spinning disk.

Quoted 7 lines
Quoted 5 lines

Thank you for this patch.

Apart from the tyop, would it be possible to fix the formatting to look less strange? (Unless you use this to transport a super-secret message steganographically to an alien planet or some such, of course.)

Ping?

I didn't had the time to send a patch yet -
so either you feel free to amend the commit message locally and queue that - or I send a new version in 2 weeks.

#13 lore raw

PATCH v3 1/1 t0027: tests are not expensive; remove t0025

In reply to Torsten Bögershausen

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

All tests in t0025 are covered by t0027 already, so that t0025 can be retired. t0027 takes less than 14 seconds under Linux, and 63 seconds under Mac Os X, and this is more or less the same with a SSD or a spinning disk.

---
 t/t0025-crlf-auto.sh | 181 ---------------------------------------------------
 t/t0027-auto-crlf.sh |   6 --
 2 files changed, 187 deletions(-)
 delete mode 100755 t/t0025-crlf-auto.sh
t/t0025-crlf-auto.sh deleted +0 -181
deleted file mode 100755
index 89826c5..0000000
@@ -1,181 +0,0 @@
-#!/bin/sh
-
-test_description='CRLF conversion'
-
-. ./test-lib.sh
-
-has_cr() {
-	tr '\015' Q <"$1" | grep Q >/dev/null
-}
-
-test_expect_success setup '
-
-	git config core.autocrlf false &&
-
-	for w in Hello world how are you; do echo $w; done >LFonly &&
-	for w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >CRLFonly &&
-	for w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >LFwithNUL &&
-	git add . &&
-
-	git commit -m initial &&
-
-	LFonly=$(git rev-parse HEAD:LFonly) &&
-	CRLFonly=$(git rev-parse HEAD:CRLFonly) &&
-	LFwithNUL=$(git rev-parse HEAD:LFwithNUL) &&
-
-	echo happy.
-'
-
-test_expect_success 'default settings cause no changes' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'crlf=true causes a CRLF file to be normalized' '
-
-	# Backwards compatibility check
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "CRLFonly crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	# Note, "normalized" means that git will normalize it if added
-	has_cr CRLFonly &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	test -n "$CRLFonlydiff"
-'
-
-test_expect_success 'text=true causes a CRLF file to be normalized' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "CRLFonly text" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	# Note, "normalized" means that git will normalize it if added
-	has_cr CRLFonly &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	test -n "$CRLFonlydiff"
-'
-
-test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf false &&
-	echo "LFonly eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf input &&
-	echo "LFonly eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "LFonly eol=lf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	test -z "$LFonlydiff"
-'
-
-test_expect_success 'autocrlf=true does not normalize CRLF files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'text=auto, autocrlf=true does not normalize CRLF files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "* text=auto" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFonly &&
-	has_cr CRLFonly &&
-	LFonlydiff=$(git diff LFonly) &&
-	CRLFonlydiff=$(git diff CRLFonly) &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
-'
-
-test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	git config core.autocrlf true &&
-	echo "* text=auto" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	! has_cr LFwithNUL &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFwithNULdiff"
-'
-
-test_expect_success 'eol=crlf _does_ normalize binary files' '
-
-	rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
-	echo "LFwithNUL eol=crlf" > .gitattributes &&
-	git read-tree --reset -u HEAD &&
-
-	has_cr LFwithNUL &&
-	LFwithNULdiff=$(git diff LFwithNUL) &&
-	test -z "$LFwithNULdiff"
-'
-
-test_expect_success 'prepare unnormalized' '
-	> .gitattributes &&
-	git config core.autocrlf false &&
-	printf "LINEONE\nLINETWO\r\n"     >mixed &&
-	git add mixed .gitattributes &&
-	git commit -m "Add mixed" &&
-	git ls-files --eol | egrep "i/crlf" &&
-	git ls-files --eol | egrep "i/mixed"
-'
-
-test_expect_success 'normalize unnormalized' '
-	echo "* text=auto" >.gitattributes &&
-	rm .git/index &&
-	git add . &&
-	git commit -m "Introduce end-of-line normalization" &&
-	git ls-files --eol | tr "\\t" " " | sort >act &&
-cat >exp <<EOF &&
-i/-text w/-text attr/text=auto         LFwithNUL
-i/lf    w/crlf  attr/text=auto         CRLFonly
-i/lf    w/crlf  attr/text=auto         LFonly
-i/lf    w/lf    attr/text=auto         .gitattributes
-i/lf    w/mixed attr/text=auto         mixed
-EOF
-	test_cmp exp act
-'
-
-test_done
t/t0027-auto-crlf.sh +0 -6
index 90db54c..effc3db 100755
@@ -4,12 +4,6 @@ test_description='CRLF conversion all combinations'
 
 . ./test-lib.sh
 
-if ! test_have_prereq EXPENSIVE
-then
-	skip_all="EXPENSIVE not set"
-	test_done
-fi
-
 compare_files () {
 	tr '\015\000' QN <"$1" >"$1".expect &&
 	tr '\015\000' QN <"$2" | tr -d 'Z' >"$2".actual &&
Signature · 1 line
2.10.0
Acked-by on v3 1/1
#14 lore raw

Re: [PATCH v3 1/1] t0027: tests are not expensive; remove t0025

Hi,

Quoted 15 lines · On Wed, 10 May 2017, [email protected] wrote:

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

Quoted 6 lines

All tests in t0025 are covered by t0027 already, so that t0025 can be retired. t0027 takes less than 14 seconds under Linux, and 63 seconds under Mac Os X, and this is more or less the same with a SSD or a spinning disk.

This is still formatted very awkwardly. How about this instead (I fixed the formatting, reworded a little here and there, and fixed the order of the footers)?

-- snipsnap --
From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add". Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

However, the "Git for Windows" fork overrides this since 2014: "t0027 is marked expensive, but really, for MinGW we want to run these tests always."

The test seems not to be expensive on other platforms at all: it takes less than 14 seconds under Linux, and 63 seconds under Mac Os X, and this is more or less the same with a SSD or a spinning disk.

So let's drop the "EXPENSIVE" prereq.

While at it, retire t0025: Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider <[email protected]>, but all tests in t0025 are covered by t0027 already.

#15 lore raw

Re: [PATCH v3 1/1] t0027: tests are not expensive; remove t0025

Ok for me, thanks for helping out.

Quoted 55 lines

Am 10.05.2017 um 17:52 schrieb Johannes Schindelin <[email protected]>:

Hi,

Quoted 17 lines · On Wed, 10 May 2017, [email protected] wrote:

From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider, [email protected]

Quoted 6 lines

All tests in t0025 are covered by t0027 already, so that t0025 can be retired. t0027 takes less than 14 seconds under Linux, and 63 seconds under Mac Os X, and this is more or less the same with a SSD or a spinning disk.

This is still formatted very awkwardly. How about this instead (I fixed the formatting, reworded a little here and there, and fixed the order of the footers)?

-- snipsnap --
From: Torsten Bögershausen <[email protected]>

The purpose of t0027 is to test all CRLF related conversions at "git checkout" and "git add". Running t0027 under Git for Windows takes 3-4 minutes, so the whole script had been marked as "EXPENSIVE".

However, the "Git for Windows" fork overrides this since 2014: "t0027 is marked expensive, but really, for MinGW we want to run these tests always."

The test seems not to be expensive on other platforms at all: it takes less than 14 seconds under Linux, and 63 seconds under Mac Os X, and this is more or less the same with a SSD or a spinning disk.

So let's drop the "EXPENSIVE" prereq.

While at it, retire t0025: Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider <[email protected]>, but all tests in t0025 are covered by t0027 already.

#16 lore raw

Re: [PATCH v3 1/1] t0027: tests are not expensive; remove t0025

Quoted 11 lines · Torstem Bögershausen
Quoted 9 lines

Am 10.05.2017 um 17:52 schrieb Johannes Schindelin <[email protected]>:

...
While at it, retire t0025: Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider <[email protected]>, but all tests in t0025 are covered by t0027 already.

Ok for me, thanks for helping out.

I'll do a s/if flaky/is flaky/ and queue it.

Thanks, both.