{"thread":{"id":"6777","subject":"git-svn test suite failures due to Subversion race","startedAt":"2007-02-12T03:32:46Z","lastAt":"2007-02-14T01:35:58Z","messageCount":7,"participants":["Michael Spang","Eric Wong","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34235","messageId":"45CFDFDE.8080907@uwaterloo.ca","threadId":"6777","inReplyTo":null,"subject":"git-svn test suite failures due to Subversion race","fromName":"Michael Spang","fromEmail":"mspang@uwaterloo.ca","sentAt":"2007-02-12T03:32:46Z","receivedAt":"2007-02-12T03:32:46Z","isPatch":false,"sender":{"key":"mspang@uwaterloo.ca","avatar":null},"body":"Some of the git-svn tests can fail on fast machines due to a race in\nSubversion: if a file is modified in the same second it was checked out\n(or in for that matter), Subversion will not consider it modified.\nApparently there is also a \"racy Subversion\" problem parallel to the\n\"racy-git\" problem. The machine is an Athlon 64 X2 3800+.\n\nFor example, test #3 of t9106-git-svn-commit-diff-clobber.sh will fail\nif Subversion happens to fail to make any commit in test #2 of the same\nfile. Test #2 will silently pass if no commit was made, as it is not an\nerror to commit nothing. The commit in #3 is supposed to conflict with\nthe one from #2, but obviously won't if that commit wasn't made. So in\nthis case test #3's commit succeeds when failure is expected, and the\ntest fails. The [annotated] output of a test run where this happens is\nattached. A couple of other tests have the same problem.\n\nThis may be a known issue, but my search of the archives was fruitless\nand it doesn't appear to be documented anywhere. It's obviously one that\nwould need to ultimately be fixed in Subversion, although a workaround\nin the test suite might help those whose builds depend on a passing test\nsuite. It's problematic for me to have the git test suite fail because\nthe git package for Debian runs the test suite while building, and will\nabort the build if there are failures.\n\nUntil this race is fixed in Subversion I guess I'm stuck either skipping\nthe git-svn tests or inserting `sleep 1` in a few places to work around\nit. A patch that works around this problem in all of the tests that\nfailed for me is attached in case its useful to someone. Even faster\nmachines may reveal more instances of the problem. I did not attempt to\n\"fix\" any tests that will still pass if commits are lost.\n\nCheers,\nMichael Spang\n\n\n>From 97e90fcd7cf600726ec468016eb37d1e1de38dde Mon Sep 17 00:00:00 2001\nFrom: Michael Spang <mspang@uwaterloo.ca>\nDate: Sun, 11 Feb 2007 20:56:22 -0500\nSubject: [PATCH] Work around Subversion race in git-svn tests.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n t/t9103-git-svn-graft-branches.sh      |    1 +\n t/t9106-git-svn-commit-diff-clobber.sh |    2 ++\n 2 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh\nindex 4e55778..f90f3a8 100755\n--- a/t/t9103-git-svn-graft-branches.sh\n+++ b/t/t9103-git-svn-graft-branches.sh\n@@ -14,6 +14,7 @@ test_expect_success 'initialize repo' \"\n \tsvn cp -m 'tag a' $svnrepo/trunk $svnrepo/tags/a &&\n \tsvn cp -m 'branch a' $svnrepo/trunk $svnrepo/branches/a &&\n \tsvn co $svnrepo wc &&\n+\tsleep 1 &&\n \tcd wc &&\n \techo feedme >> branches/a/readme &&\n \tsvn commit -m hungry &&\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex 59b6425..70c9f58 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -16,6 +16,7 @@ test_expect_success 'initialize repo' \"\n \t\"\n test_expect_success 'commit change from svn side' \"\n \tsvn co $svnrepo t.svn &&\n+\tsleep 1 &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n \tsvn commit -m 'second line from svn' &&\n@@ -43,6 +44,7 @@ test_expect_failure 'dcommit fails to commit because of conflict' \"\n \tgit-svn fetch &&\n \tgit reset --hard refs/remotes/git-svn &&\n \tsvn co $svnrepo t.svn &&\n+\tsleep 1 &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n \tsvn commit -m 'fourth line from svn' &&\n-- \n1.5.0.rc4.gcc46a\n\n\n\n001    $ sh t9106-git-svn-commit-diff-clobber.sh -v\n002    * expecting success:\n003            mkdir import &&\n004            cd import &&\n005            echo initial > file &&\n006            svn import -m 'initial' . file:///users/mspang/src/git/git/t/trash/svnrepo &&\n007            cd .. &&\n008            echo initial > file &&\n009            git update-index --add file &&\n010            git commit -a -m 'initial'\n011\n012    Adding         file\n013\n014    Committed revision 1.\n015    Created initial commit 39d53013acc58c2675a4d856da562282c21f5235\n016     1 files changed, 1 insertions(+), 0 deletions(-)\n017     create mode 100644 file\n018    *   ok 1: initialize repo\n019\n020    * expecting success:\n021            svn co file:///users/mspang/src/git/git/t/trash/svnrepo t.svn &&\n022            cd t.svn &&\n023            echo second line from svn >> file &&\n024            svn commit -m 'second line from svn' &&\n025            cd .. &&\n026            rm -rf t.svn\n027\n028    A    t.svn/file\n029    Checked out revision 1.\n\n[missing]   Sending        file\n[missing]   Transmitting file data .\n[missing]   Committed revision 2.\n\n030    *   ok 2: commit change from svn side\n031\n032    * expecting failure:\n033            echo second line from git >> file &&\n034            git commit -a -m 'second line from git' &&\n035            git-svn commit-diff -r1 HEAD~1 HEAD file:///users/mspang/src/git/git/t/trash/svnrepo\n036\n037    Created commit eafa51760d91bfcfa1ce7e4f18bd0854cc723333\n038     1 files changed, 1 insertions(+), 0 deletions(-)\n039    diff-tree HEAD~1 HEAD\n040            M       file\n041    Committed 2\n042    * FAIL 3: commit conflicting change from git\n\n[fails due to last missing commit]\n\n043\n044                    echo second line from git >> file &&\n045                    git commit -a -m 'second line from git' &&\n046                    git-svn commit-diff -r1 HEAD~1 HEAD file:///users/mspang/src/git/git/t/trash/svnrepo\n047\n048\n049    * expecting success:\n050            git reset --hard HEAD~1 &&\n051            echo second line from svn >> file &&\n052            git commit -a -m 'second line from svn' &&\n053            echo third line from git >> file &&\n054            git commit -a -m 'third line from git' &&\n055            git-svn commit-diff -r2 HEAD~1 HEAD file:///users/mspang/src/git/git/t/trash/svnrepo\n056\n057    HEAD is now at 39d5301... initial\n058    Created commit c8ce91056ec7f8082bc1f86f5233b3c73f952ff5\n059     1 files changed, 1 insertions(+), 0 deletions(-)\n060    Created commit c6cfbf71727661a3ca3d25144fe0c579ff8e02fb\n061     1 files changed, 1 insertions(+), 0 deletions(-)\n062    diff-tree HEAD~1 HEAD\n063            M       file\n064    Committed 3\n065    *   ok 4: commit complementing change from git\n066\n067    * expecting failure:\n068            git-svn init file:///users/mspang/src/git/git/t/trash/svnrepo &&\n069            git-svn fetch &&\n070            git reset --hard refs/remotes/git-svn &&\n071            svn co file:///users/mspang/src/git/git/t/trash/svnrepo t.svn &&\n072            cd t.svn &&\n073            echo fourth line from svn >> file &&\n074            svn commit -m 'fourth line from svn' &&\n075            cd .. &&\n076            rm -rf t.svn &&\n077            echo 'fourth line from git' >> file &&\n078            git commit -a -m 'fourth line from git' &&\n079            git-svn dcommit\n080\n081    Fetching git-svn\n082    r0 = 103011a5e58371b0034e4655e82bbda686e3e60b\n083            A       file\n084    r1 = 2555b1052c176cd6de86b775797b9e7924c1ea04\n085            M       file\n086    r2 = 3e520e5a40bda6e97c37e1ae37dbb0583608e7e1\n087            M       file\n088    r3 = e47289f12d30749c4b25762d402cc1762afbdd01\n089    HEAD is now at e47289f... third line from git\n090    A    t.svn/file\n091    Checked out revision 3.\n\n[missing]   Sending        file\n[missing]   Transmitting file data .\n[missing]   Committed revision 4.\n\n092    Created commit b5ccb76480136befc4d702e1c8764897162cbc72\n093     1 files changed, 1 insertions(+), 0 deletions(-)\n094    diff-tree b5ccb76480136befc4d702e1c8764897162cbc72~1 b5ccb76480136befc4d702e1c8764897162cbc72\n095            M       file\n096    Committed 4\n097            M       file\n098    r4 = acaf5f49b02286596bd8f27139bf374082c7afaf\n099    No changes between current HEAD and refs/remotes/git-svn\n100    Resetting to the latest refs/remotes/git-svn\n101    * FAIL 5: dcommit fails to commit because of conflict\n\n[fails due to last missing commit]\n\n102\n103                    git-svn init file:///users/mspang/src/git/git/t/trash/svnrepo &&\n104                    git-svn fetch &&\n105                    git reset --hard refs/remotes/git-svn &&\n106                    svn co file:///users/mspang/src/git/git/t/trash/svnrepo t.svn &&\n107                   cd t.svn &&\n108                    echo fourth line from svn >> file &&\n109                    svn commit -m 'fourth line from svn' &&\n110                    cd .. &&\n111                    rm -rf t.svn &&\n112                    echo 'fourth line from git' >> file &&\n113                    git commit -a -m 'fourth line from git' &&\n114                    git-svn dcommit\n115\n116\n117    * expecting success:\n118            git reset --hard refs/remotes/git-svn &&\n119            echo 'index merge' > file2 &&\n120            git update-index --add file2 &&\n121            git commit -a -m 'index merge' &&\n122            echo 'more changes' >> file2 &&\n123            git update-index file2 &&\n124            git commit -a -m 'more changes' &&\n125            git-svn dcommit\n126\n127    HEAD is now at acaf5f4... fourth line from git\n128    Created commit 4f898d08f8011241134e983cc30d98785e926f13\n129     1 files changed, 1 insertions(+), 0 deletions(-)\n130     create mode 100644 file2\n131    Created commit 59cf4e5baa0fd3d444d3a084d5e8a87328ddfcae\n132     1 files changed, 1 insertions(+), 0 deletions(-)\n133    diff-tree 4f898d08f8011241134e983cc30d98785e926f13~1 4f898d08f8011241134e983cc30d98785e926f13\n134            A       file2\n135    Committed 5\n136    diff-tree 59cf4e5baa0fd3d444d3a084d5e8a87328ddfcae~1 59cf4e5baa0fd3d444d3a084d5e8a87328ddfcae\n137            M       file2\n138    Committed 6\n139            A       file2\n140    r5 = caed42b00cded960103b70a51b4c81194f94c960\n141            M       file2\n142    r6 = 8e8a98024de9b2469e94815fea87492728ef1fc4\n143    No changes between current HEAD and refs/remotes/git-svn\n144    Resetting to the latest refs/remotes/git-svn\n145    *   ok 6: dcommit does the svn equivalent of an index merge\n146\n147    * failed 2 among 6 test(s)\n"},{"id":"34271","messageId":"20070212103822.GA21413@localdomain","threadId":"6777","inReplyTo":"45CFDFDE.8080907@uwaterloo.ca","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-02-12T10:38:22Z","receivedAt":"2007-02-12T10:38:22Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michael Spang <mspang@uwaterloo.ca> wrote:\n> Some of the git-svn tests can fail on fast machines due to a race in\n> Subversion: if a file is modified in the same second it was checked out\n> (or in for that matter), Subversion will not consider it modified.\n> Apparently there is also a \"racy Subversion\" problem parallel to the\n> \"racy-git\" problem. The machine is an Athlon 64 X2 3800+.\n\nI don't think any of my machines are even half as fast.  The git-svn\ntests take a long time on my dev machine, so we have entirely different\nissues.\n\n> For example, test #3 of t9106-git-svn-commit-diff-clobber.sh will fail\n> if Subversion happens to fail to make any commit in test #2 of the same\n> file. Test #2 will silently pass if no commit was made, as it is not an\n> error to commit nothing. The commit in #3 is supposed to conflict with\n> the one from #2, but obviously won't if that commit wasn't made. So in\n> this case test #3's commit succeeds when failure is expected, and the\n> test fails. The [annotated] output of a test run where this happens is\n> attached. A couple of other tests have the same problem.\n> \n> This may be a known issue, but my search of the archives was fruitless\n> and it doesn't appear to be documented anywhere. It's obviously one that\n> would need to ultimately be fixed in Subversion, although a workaround\n> in the test suite might help those whose builds depend on a passing test\n> suite. It's problematic for me to have the git test suite fail because\n> the git package for Debian runs the test suite while building, and will\n> abort the build if there are failures.\n\nNot known to me.  This is the first time I've heard of this issue; but\nI'm not at all surprised that this is happening, though.\n\n> Until this race is fixed in Subversion I guess I'm stuck either skipping\n> the git-svn tests or inserting `sleep 1` in a few places to work around\n> it. A patch that works around this problem in all of the tests that\n> failed for me is attached in case its useful to someone. Even faster\n> machines may reveal more instances of the problem. I did not attempt to\n> \"fix\" any tests that will still pass if commits are lost.\n\nThis is disconcerting.  Given that hardware is still getting faster, I\nsuspect there will be many more problems with the svn tests in the\nfuture.  I have no plans for upgrading hardware in the near future; so I\nwon't be hitting these problems myself.\n\nI'm alright with adding the `sleep 1` in several more places where this\ncan be an issue.  If it gets bad enough for people with slower\ncomputers, I'll probably just create a function that sleeps only if a\nvariable is not set (TOO_SLOW_TO_RACE=1 :)\n\nI've been considering rewriting the tests to use the Perl SVN::\nlibraries exclusively; but that runs the risk of introducing new bugs.\n\n> From 97e90fcd7cf600726ec468016eb37d1e1de38dde Mon Sep 17 00:00:00 2001\n> From: Michael Spang <mspang@uwaterloo.ca>\n> Date: Sun, 11 Feb 2007 20:56:22 -0500\n> Subject: [PATCH] Work around Subversion race in git-svn tests.\n> \n> Signed-off-by: Michael Spang <mspang@uwaterloo.ca>\n\nIt would've been good to have the above email explanation above in the\ncommit message below so we know why the patch was needed (when it gets\napplied).\n\n-- \nEric Wong\n"},{"id":"34363","messageId":"45D1239C.4040706@gmail.com","threadId":"6777","inReplyTo":"20070212103822.GA21413@localdomain","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Michael Spang","fromEmail":"mcspang@gmail.com","sentAt":"2007-02-13T02:34:04Z","receivedAt":"2007-02-13T02:34:04Z","isPatch":false,"sender":{"key":"mcspang@gmail.com","avatar":null},"body":"Eric Wong wrote:\n> This is disconcerting.  Given that hardware is still getting faster, I\n> suspect there will be many more problems with the svn tests in the\n> future.  I have no plans for upgrading hardware in the near future; so I\n> won't be hitting these problems myself.\n>\n> I'm alright with adding the `sleep 1` in several more places where this\n> can be an issue.  If it gets bad enough for people with slower\n> computers, I'll probably just create a function that sleeps only if a\n> variable is not set (TOO_SLOW_TO_RACE=1 :)\n>\n> I've been considering rewriting the tests to use the Perl SVN::\n> libraries exclusively; but that runs the risk of introducing new bugs.\n>   \n\nI've prepared a somewhat cleaner patch that solves the problem without\nusing sleep. It increases the modification time by one second\nimmediately prior to each commit. I added calls everywhere I think the\nproblem could potentially occur.\n\nI've had no failures with the patch (without it, they are quite frequent).\n\nCheers,\nMichael Spang\n\n\n>From f3a86250469df6607b71da235ac69ccb82d59fd9 Mon Sep 17 00:00:00 2001\nFrom: Michael Spang <mspang@uwaterloo.ca>\nDate: Mon, 12 Feb 2007 19:33:37 -0500\nSubject: [PATCH] Work around Subversion race in git-svn tests.\n\nSome of the git-svn tests can fail on fast machines due to a race in\nSubversion: if a file is modified in the same second it was checked out\n(or in for that matter), Subversion will not consider it modified. This\nworks around the problem by increasing the timestamp by one second\nbefore each commit.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n t/lib-git-svn.sh                       |    3 +++\n t/t9101-git-svn-props.sh               |    7 +++++--\n t/t9103-git-svn-graft-branches.sh      |    1 +\n t/t9104-git-svn-follow-parent.sh       |    2 ++\n t/t9106-git-svn-commit-diff-clobber.sh |    2 ++\n 5 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex bb1d7b8..71e8010 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -45,3 +45,6 @@ fi\n svnrepo=\"file://$svnrepo\"\n \n \n+poke() {\n+\ttouch -r \"$1\" -d +1sec \"$1\"\n+}\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex a2c4dc3..e8133d8 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -56,11 +56,14 @@ test_expect_success 'checkout working copy from svn' \"svn co $svnrepo test_wc\"\n test_expect_success 'setup some commits to svn' \\\n \t'cd test_wc &&\n \t\techo Greetings >> kw.c &&\n+\t\tpoke kw.c &&\n \t\tsvn commit -m \"Not yet an Id\" &&\n \t\techo Hello world >> kw.c &&\n+\t\tpoke kw.c &&\n \t\tsvn commit -m \"Modified file, but still not yet an Id\" &&\n \t\tsvn propset svn:keywords Id kw.c &&\n-\t\tsvn commit -m \"Propset Id\"\n+\t\tpoke kw.c &&\n+\t\tsvn commit -m \"Propset Id\" &&\n \tcd ..'\n \n test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n@@ -83,7 +86,7 @@ test_expect_success \"propset CR on crlf files\" \\\n \t\tsvn propset svn:eol-style CR empty &&\n \t\tsvn propset svn:eol-style CR crlf &&\n \t\tsvn propset svn:eol-style CR ne_crlf &&\n-\t\tsvn commit -m \"propset CR on crlf files\"\n+\t\tsvn commit -m \"propset CR on crlf files\" &&\n \t cd ..'\n \n test_expect_success 'fetch and pull latest from svn and checkout a new wc' \\\ndiff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh\nindex 4e55778..183ae3b 100755\n--- a/t/t9103-git-svn-graft-branches.sh\n+++ b/t/t9103-git-svn-graft-branches.sh\n@@ -16,6 +16,7 @@ test_expect_success 'initialize repo' \"\n \tsvn co $svnrepo wc &&\n \tcd wc &&\n \techo feedme >> branches/a/readme &&\n+\tpoke branches/a/readme &&\n \tsvn commit -m hungry &&\n \tcd trunk &&\n \tsvn merge -r3:4 $svnrepo/branches/a &&\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 8d2e2fe..405b555 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -16,11 +16,13 @@ test_expect_success 'initialize repo' \"\n \tsvn co $svnrepo wc &&\n \tcd wc &&\n \techo world >> trunk/readme &&\n+\tpoke trunk/readme &&\n \tsvn commit -m 'another commit' &&\n \tsvn up &&\n \tsvn mv -m 'rename to thunk' trunk thunk &&\n \tsvn up &&\n \techo goodbye >> thunk/readme &&\n+\tpoke thunk/readme &&\n \tsvn commit -m 'bye now' &&\n \tcd ..\n \t\"\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex 59b6425..6f132f2 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -18,6 +18,7 @@ test_expect_success 'commit change from svn side' \"\n \tsvn co $svnrepo t.svn &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n+\tpoke file &&\n \tsvn commit -m 'second line from svn' &&\n \tcd .. &&\n \trm -rf t.svn\n@@ -45,6 +46,7 @@ test_expect_failure 'dcommit fails to commit because of conflict' \"\n \tsvn co $svnrepo t.svn &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n+\tpoke file &&\n \tsvn commit -m 'fourth line from svn' &&\n \tcd .. &&\n \trm -rf t.svn &&\n-- \n1.5.0.rc4.26.gcc46a\n\n"},{"id":"34364","messageId":"7vhctq4v4e.fsf@assigned-by-dhcp.cox.net","threadId":"6777","inReplyTo":"45D1239C.4040706@gmail.com","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T03:03:13Z","receivedAt":"2007-02-13T03:03:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Spang <mcspang@gmail.com> writes:\n\n> I've had no failures with the patch (without it, they are quite frequent).\n>\n\nI've seen the failures myself without the patch, and working it\naround is a good thing, however...\n\n> Cheers,\n> Michael Spang\n> From f3a86250469df6607b71da235ac69ccb82d59fd9 Mon Sep 17 00:00:00 2001\n> From: Michael Spang <mspang@uwaterloo.ca>\n> Date: Mon, 12 Feb 2007 19:33:37 -0500\n> Subject: [PATCH] Work around Subversion race in git-svn tests.\n>\n> +poke() {\n> +\ttouch -r \"$1\" -d +1sec \"$1\"\n> +}\n\nI wonder how portable this might be.\n"},{"id":"34367","messageId":"20070213032137.GA28534@localdomain","threadId":"6777","inReplyTo":"45D1239C.4040706@gmail.com","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-02-13T03:21:37Z","receivedAt":"2007-02-13T03:21:37Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michael Spang <mcspang@gmail.com> wrote:\n> I've prepared a somewhat cleaner patch that solves the problem without\n> using sleep. It increases the modification time by one second\n> immediately prior to each commit. I added calls everywhere I think the\n> problem could potentially occur.\n> \n> I've had no failures with the patch (without it, they are quite frequent).\n\nThanks for the patch.  Just one portability nit below, otherwise:\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> +poke() {\n> +\ttouch -r \"$1\" -d +1sec \"$1\"\n> +}\n\nI'm not sure that -d is portable.  However,\n\n  perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' \"$1\"\n\nshould work on any platform git-svn runs on.\n\n-- \nEric Wong\n"},{"id":"34381","messageId":"7vps8e1sz7.fsf@assigned-by-dhcp.cox.net","threadId":"6777","inReplyTo":"20070213032137.GA28534@localdomain","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-13T06:17:48Z","receivedAt":"2007-02-13T06:17:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Thanks for the patch.  Just one portability nit below, otherwise:\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>> +poke() {\n>> +\ttouch -r \"$1\" -d +1sec \"$1\"\n>> +}\n>\n> I'm not sure that -d is portable.  However,\n>\n>   perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' \"$1\"\n>\n> should work on any platform git-svn runs on.\n\nSounds sensible, as git-svn wants perl-svn libraries already\nanyway.\n"},{"id":"34489","messageId":"45D2677E.9030408@gmail.com","threadId":"6777","inReplyTo":"20070213032137.GA28534@localdomain","subject":"Re: git-svn test suite failures due to Subversion race","fromName":"Michael Spang","fromEmail":"mcspang@gmail.com","sentAt":"2007-02-14T01:35:58Z","receivedAt":"2007-02-14T01:35:58Z","isPatch":false,"sender":{"key":"mcspang@gmail.com","avatar":null},"body":"Eric Wong wrote:\n> Michael Spang <mcspang@gmail.com> wrote:\n>   \n>> I've prepared a somewhat cleaner patch that solves the problem without\n>> using sleep. It increases the modification time by one second\n>> immediately prior to each commit. I added calls everywhere I think the\n>> problem could potentially occur.\n>>\n>> I've had no failures with the patch (without it, they are quite frequent).\n>>     \n>\n> Thanks for the patch.  Just one portability nit below, otherwise:\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>   \n>> +poke() {\n>> +\ttouch -r \"$1\" -d +1sec \"$1\"\n>> +}\n>>     \n>\n> I'm not sure that -d is portable.  However,\n>\n>   perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' \"$1\"\n>\n> should work on any platform git-svn runs on.\n>\n>   \n\nDoh. I knew that option to touch was too good to be true. Having it in\nPerl may also make it easier for you if you decide to go ahead with\nrewriting the tests to use only the Perl bindings. Assuming a workaround\nis still needed, anyway--I've never used Subversion with Perl. Thanks\nfor the tips.\n\nMichael Spang\n\n\n>From e632a69547531eb3459a55513ebc2e020b19eb57 Mon Sep 17 00:00:00 2001\nFrom: Michael Spang <mspang@uwaterloo.ca>\nDate: Mon, 12 Feb 2007 19:33:37 -0500\nSubject: [PATCH] Work around Subversion race in git-svn tests.\n\nSome of the git-svn tests can fail on fast machines due to a race in\nSubversion: if a file is modified in the same second it was checked out\n(or in for that matter), Subversion will not consider it modified. This\nworks around the problem by increasing the timestamp by one second\nbefore each commit.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\nAcked-by: Eric Wong <normalperson@yhbt.net>\n---\n t/lib-git-svn.sh                       |    3 +++\n t/t9101-git-svn-props.sh               |    7 +++++--\n t/t9103-git-svn-graft-branches.sh      |    1 +\n t/t9104-git-svn-follow-parent.sh       |    2 ++\n t/t9106-git-svn-commit-diff-clobber.sh |    2 ++\n 5 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex bb1d7b8..67d08cf 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -45,3 +45,6 @@ fi\n svnrepo=\"file://$svnrepo\"\n \n \n+poke() {\n+\tperl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' \"$1\"\n+}\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex a2c4dc3..e8133d8 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -56,11 +56,14 @@ test_expect_success 'checkout working copy from svn' \"svn co $svnrepo test_wc\"\n test_expect_success 'setup some commits to svn' \\\n \t'cd test_wc &&\n \t\techo Greetings >> kw.c &&\n+\t\tpoke kw.c &&\n \t\tsvn commit -m \"Not yet an Id\" &&\n \t\techo Hello world >> kw.c &&\n+\t\tpoke kw.c &&\n \t\tsvn commit -m \"Modified file, but still not yet an Id\" &&\n \t\tsvn propset svn:keywords Id kw.c &&\n-\t\tsvn commit -m \"Propset Id\"\n+\t\tpoke kw.c &&\n+\t\tsvn commit -m \"Propset Id\" &&\n \tcd ..'\n \n test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n@@ -83,7 +86,7 @@ test_expect_success \"propset CR on crlf files\" \\\n \t\tsvn propset svn:eol-style CR empty &&\n \t\tsvn propset svn:eol-style CR crlf &&\n \t\tsvn propset svn:eol-style CR ne_crlf &&\n-\t\tsvn commit -m \"propset CR on crlf files\"\n+\t\tsvn commit -m \"propset CR on crlf files\" &&\n \t cd ..'\n \n test_expect_success 'fetch and pull latest from svn and checkout a new wc' \\\ndiff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh\nindex 4e55778..183ae3b 100755\n--- a/t/t9103-git-svn-graft-branches.sh\n+++ b/t/t9103-git-svn-graft-branches.sh\n@@ -16,6 +16,7 @@ test_expect_success 'initialize repo' \"\n \tsvn co $svnrepo wc &&\n \tcd wc &&\n \techo feedme >> branches/a/readme &&\n+\tpoke branches/a/readme &&\n \tsvn commit -m hungry &&\n \tcd trunk &&\n \tsvn merge -r3:4 $svnrepo/branches/a &&\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 8d2e2fe..405b555 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -16,11 +16,13 @@ test_expect_success 'initialize repo' \"\n \tsvn co $svnrepo wc &&\n \tcd wc &&\n \techo world >> trunk/readme &&\n+\tpoke trunk/readme &&\n \tsvn commit -m 'another commit' &&\n \tsvn up &&\n \tsvn mv -m 'rename to thunk' trunk thunk &&\n \tsvn up &&\n \techo goodbye >> thunk/readme &&\n+\tpoke thunk/readme &&\n \tsvn commit -m 'bye now' &&\n \tcd ..\n \t\"\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex 59b6425..6f132f2 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -18,6 +18,7 @@ test_expect_success 'commit change from svn side' \"\n \tsvn co $svnrepo t.svn &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n+\tpoke file &&\n \tsvn commit -m 'second line from svn' &&\n \tcd .. &&\n \trm -rf t.svn\n@@ -45,6 +46,7 @@ test_expect_failure 'dcommit fails to commit because of conflict' \"\n \tsvn co $svnrepo t.svn &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n+\tpoke file &&\n \tsvn commit -m 'fourth line from svn' &&\n \tcd .. &&\n \trm -rf t.svn &&\n-- \n1.5.0.rc4.26.gcc46a\n\n"}]}