git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFH] Spurious failures of t0025.[34]

From
Thomas Rast <trast@student.ethz.ch>
Date
Jul 29, 2010, 21:40 UTC
Message-ID
<201007292340.01836.trast@student.ethz.ch>
Hi *

I have another hard-to-explain test failure under --valgrind. I hope it's not yet another bug buried deep in valgrind itself...

Doing the following on current next (v1.7.2.1-230-g75e8ac1) stops after a number of iterations, usually within 5 minutes:

  while GIT_SKIP_TESTS="t0025.[5-9] t0025.??" \
      ./t0025-crlf-auto.sh --valgrind --root=/dev/shm --tee -i
  do
    :
  done

I can reproduce this both on the machine I use for valgrinding, and my work laptop, and they're quite different:

  openSuSE 11.3, 2.6.34, gcc 4.5.0, glibc 2.11.2
  RHEL 5.4, 2.6.18, gcc 4.1.2, glibc 2.5

I ordinarily run a bleeding edge valgrind on both (calls itself 3.6.0SVN) because of the env handling bug from last month, but I also tried with valgrind 3.5.0 on the RHEL box, same problem.

It seems random whether it stops at test 3 or 4, but #4 seems more frequent. These tests read

  test_expect_success 'crlf=true causes a CRLF file to be normalized' '
          # Backwards compatibility check
          rm -f .gitattributes tmp one two three &&
          echo "two crlf" > .gitattributes &&
          git read-tree --reset -u HEAD &&
          # Note, "normalized" means that git will normalize it if added
          has_cr two &&
          twodiff=`git diff two` &&
          test -n "$twodiff"
  '
  test_expect_success 'text=true causes a CRLF file to be normalized' '
          rm -f .gitattributes tmp one two three &&
          echo "two text" > .gitattributes &&
          git read-tree --reset -u HEAD &&
          # Note, "normalized" means that git will normalize it if added
          has_cr two &&
          twodiff=`git diff two` &&
          test -n "$twodiff"
  '
I tried patching them in this way:
---- 8< ----
diff --git i/t/t0025-crlf-auto.sh w/t/t0025-crlf-auto.sh
index f5f67a6..d7424c9 100755
--- i/t/t0025-crlf-auto.sh
+++ w/t/t0025-crlf-auto.sh
@@ -48,8 +48,7 @@ test_expect_success 'crlf=true causes a CRLF file to be normalized' '
 
 	# Note, "normalized" means that git will normalize it if added
 	has_cr two &&
-	twodiff=`git diff two` &&
-	test -n "$twodiff"
+	test_must_fail git diff --exit-code two
 '
 
 test_expect_success 'text=true causes a CRLF file to be normalized' '
@@ -60,8 +59,7 @@ test_expect_success 'text=true causes a CRLF file to be normalized' '
 
 	# Note, "normalized" means that git will normalize it if added
 	has_cr two &&
-	twodiff=`git diff two` &&
-	test -n "$twodiff"
+	test_must_fail git diff --exit-code two
 '
 
 test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' '
---- >8 ----

Unless I'm too tired, these should be equivalent.  I gained no extra
information by doing so; it just stops at a random iteration with an
empty diff.  Maybe it shifts the weight slightly towards #3 failing,
but that could just as well be the placebo effect, I have not done any
statistics.  It looks like

  expecting success: 

          rm -f .gitattributes tmp one two three &&
          echo "two text" > .gitattributes &&
          git read-tree --reset -u HEAD &&

          # Note, "normalized" means that git will normalize it if added
          has_cr two &&
          xxd two &&
          test_must_fail git diff --exit-code two

  0000000: 490d 0a61 6d0d 0a76 6572 790d 0a76 6572  I..am..very..ver
  0000010: 790d 0a66 696e 650d 0a74 6861 6e6b 0d0a  y..fine..thank..
  0000020: 796f 750d 0a                             you..
  not ok - 4 text=true causes a CRLF file to be normalized
  #
  #
  #               rm -f .gitattributes tmp one two three &&
  #               echo "two text" > .gitattributes &&
  #               git read-tree --reset -u HEAD &&
  #
  #               # Note, "normalized" means that git will normalize it if added
  #               has_cr two &&
  #               xxd two &&
  #               test_must_fail git diff --exit-code two
  #

I.e., nothing out of the ordinary except that the diff is empty.

So... does anyone have any ideas what to test next?  Or what might
cause this?
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Next: Jeff King
Message 1 of 4 in “[RFH] Spurious failures of t0025.[34]”
  1. Thomas RastJul 29, 2010
  2. Jeff KingJul 30, 2010
  3. Thomas RastJul 30, 2010
  4. Thomas RastAug 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.