All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Spang <mcspang@gmail.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: Re: git-svn test suite failures due to Subversion race
Date: Mon, 12 Feb 2007 21:34:04 -0500	[thread overview]
Message-ID: <45D1239C.4040706@gmail.com> (raw)
In-Reply-To: <20070212103822.GA21413@localdomain>

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

Eric Wong wrote:
> This is disconcerting.  Given that hardware is still getting faster, I
> suspect there will be many more problems with the svn tests in the
> future.  I have no plans for upgrading hardware in the near future; so I
> won't be hitting these problems myself.
>
> I'm alright with adding the `sleep 1` in several more places where this
> can be an issue.  If it gets bad enough for people with slower
> computers, I'll probably just create a function that sleeps only if a
> variable is not set (TOO_SLOW_TO_RACE=1 :)
>
> I've been considering rewriting the tests to use the Perl SVN::
> libraries exclusively; but that runs the risk of introducing new bugs.
>   

I've prepared a somewhat cleaner patch that solves the problem without
using sleep. It increases the modification time by one second
immediately prior to each commit. I added calls everywhere I think the
problem could potentially occur.

I've had no failures with the patch (without it, they are quite frequent).

Cheers,
Michael Spang

[-- Attachment #2: 0001-Work-around-Subversion-race-in-git-svn-tests.patch --]
[-- Type: text/x-patch, Size: 3877 bytes --]

>From f3a86250469df6607b71da235ac69ccb82d59fd9 Mon Sep 17 00:00:00 2001
From: Michael Spang <mspang@uwaterloo.ca>
Date: Mon, 12 Feb 2007 19:33:37 -0500
Subject: [PATCH] Work around Subversion race in git-svn tests.

Some of the git-svn tests can fail on fast machines due to a race in
Subversion: if a file is modified in the same second it was checked out
(or in for that matter), Subversion will not consider it modified. This
works around the problem by increasing the timestamp by one second
before each commit.

Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---
 t/lib-git-svn.sh                       |    3 +++
 t/t9101-git-svn-props.sh               |    7 +++++--
 t/t9103-git-svn-graft-branches.sh      |    1 +
 t/t9104-git-svn-follow-parent.sh       |    2 ++
 t/t9106-git-svn-commit-diff-clobber.sh |    2 ++
 5 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index bb1d7b8..71e8010 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -45,3 +45,6 @@ fi
 svnrepo="file://$svnrepo"
 
 
+poke() {
+	touch -r "$1" -d +1sec "$1"
+}
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index a2c4dc3..e8133d8 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -56,11 +56,14 @@ test_expect_success 'checkout working copy from svn' "svn co $svnrepo test_wc"
 test_expect_success 'setup some commits to svn' \
 	'cd test_wc &&
 		echo Greetings >> kw.c &&
+		poke kw.c &&
 		svn commit -m "Not yet an Id" &&
 		echo Hello world >> kw.c &&
+		poke kw.c &&
 		svn commit -m "Modified file, but still not yet an Id" &&
 		svn propset svn:keywords Id kw.c &&
-		svn commit -m "Propset Id"
+		poke kw.c &&
+		svn commit -m "Propset Id" &&
 	cd ..'
 
 test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
@@ -83,7 +86,7 @@ test_expect_success "propset CR on crlf files" \
 		svn propset svn:eol-style CR empty &&
 		svn propset svn:eol-style CR crlf &&
 		svn propset svn:eol-style CR ne_crlf &&
-		svn commit -m "propset CR on crlf files"
+		svn commit -m "propset CR on crlf files" &&
 	 cd ..'
 
 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh
index 4e55778..183ae3b 100755
--- a/t/t9103-git-svn-graft-branches.sh
+++ b/t/t9103-git-svn-graft-branches.sh
@@ -16,6 +16,7 @@ test_expect_success 'initialize repo' "
 	svn co $svnrepo wc &&
 	cd wc &&
 	echo feedme >> branches/a/readme &&
+	poke branches/a/readme &&
 	svn commit -m hungry &&
 	cd trunk &&
 	svn merge -r3:4 $svnrepo/branches/a &&
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 8d2e2fe..405b555 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -16,11 +16,13 @@ test_expect_success 'initialize repo' "
 	svn co $svnrepo wc &&
 	cd wc &&
 	echo world >> trunk/readme &&
+	poke trunk/readme &&
 	svn commit -m 'another commit' &&
 	svn up &&
 	svn mv -m 'rename to thunk' trunk thunk &&
 	svn up &&
 	echo goodbye >> thunk/readme &&
+	poke thunk/readme &&
 	svn commit -m 'bye now' &&
 	cd ..
 	"
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 59b6425..6f132f2 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -18,6 +18,7 @@ test_expect_success 'commit change from svn side' "
 	svn co $svnrepo t.svn &&
 	cd t.svn &&
 	echo second line from svn >> file &&
+	poke file &&
 	svn commit -m 'second line from svn' &&
 	cd .. &&
 	rm -rf t.svn
@@ -45,6 +46,7 @@ test_expect_failure 'dcommit fails to commit because of conflict' "
 	svn co $svnrepo t.svn &&
 	cd t.svn &&
 	echo fourth line from svn >> file &&
+	poke file &&
 	svn commit -m 'fourth line from svn' &&
 	cd .. &&
 	rm -rf t.svn &&
-- 
1.5.0.rc4.26.gcc46a


  reply	other threads:[~2007-02-13  2:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12  3:32 Michael Spang
2007-02-12 10:38 ` Eric Wong
2007-02-13  2:34   ` Michael Spang [this message]
2007-02-13  3:03     ` Junio C Hamano
2007-02-13  3:21     ` Eric Wong
2007-02-13  6:17       ` Junio C Hamano
2007-02-14  1:35       ` Michael Spang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D1239C.4040706@gmail.com \
    --to=mcspang@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    --subject='Re: git-svn test suite failures due to Subversion race' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.