Patchwork tests: make test-convert-git.t reproducible

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 24, 2016, 5:45 p.m.
Message ID <ee1c5cef44af3163e958.1482601540@gps-mbp.local>
Download mbox | patch
Permalink /patch/18027/
State Accepted
Headers show

Comments

Gregory Szorc - Dec. 24, 2016, 5:45 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1482601208 25200
#      Sat Dec 24 10:40:08 2016 -0700
# Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
# Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
tests: make test-convert-git.t reproducible

For reasons I can't explain, Git's copy detection code was identifying
different source files on OS X and (presumably) Solaris versus Linux
(which the test was originally authored against). This was causing
unstable test output.

Changing the test to use a non-ambiguous source file appears to make
the test stable.

The test was introduced recently in ea3540e66fd8.
Pierre-Yves David - Dec. 24, 2016, 6:24 p.m.
On 12/24/2016 06:45 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1482601208 25200
> #      Sat Dec 24 10:40:08 2016 -0700
> # Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
> # Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
> tests: make test-convert-git.t reproducible
>
> For reasons I can't explain, Git's copy detection code was identifying
> different source files on OS X and (presumably) Solaris versus Linux
> (which the test was originally authored against). This was causing
> unstable test output.
>
> Changing the test to use a non-ambiguous source file appears to make
> the test stable.
>
> The test was introduced recently in ea3540e66fd8.

Pushed, thanks for the quick fixes.

> diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
> --- a/tests/test-convert-git.t
> +++ b/tests/test-convert-git.t
> @@ -376,29 +376,40 @@ source, the copy source took the content
>
>  renamelimit config option works
>
>    $ cd git-repo2
> -  $ cp bar bar-copy0
> -  $ echo 0 >> bar-copy0
> -  $ cp bar bar-copy1
> -  $ echo 1 >> bar-copy1
> -  $ git add bar-copy0 bar-copy1
> -  $ commit -a -m 'copy bar 2 times'
> +  $ cat >> copy-source << EOF
> +  > sc0
> +  > sc1
> +  > sc2
> +  > sc3
> +  > sc4
> +  > sc5
> +  > sc6
> +  > EOF
> +  $ git add copy-source
> +  $ commit -m 'add copy-source'
> +  $ cp copy-source source-copy0
> +  $ echo 0 >> source-copy0
> +  $ cp copy-source source-copy1
> +  $ echo 1 >> source-copy1
> +  $ git add source-copy0 source-copy1
> +  $ commit -a -m 'copy copy-source 2 times'
>    $ cd ..
>
>    $ hg -q convert --config convert.git.renamelimit=1 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
>    $ hg -R fullrepo2 status -C --change master
> -  A bar-copy0
> -  A bar-copy1
> +  A source-copy0
> +  A source-copy1
>
>    $ hg -q convert --config convert.git.renamelimit=100 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
>    $ hg -R fullrepo3 status -C --change master
> -  A bar-copy0
> -    bar
> -  A bar-copy1
> -    bar
> +  A source-copy0
> +    copy-source
> +  A source-copy1
> +    copy-source
>
>  test binary conversion (issue1359)
>
>    $ count=19
Augie Fackler - Dec. 24, 2016, 7:26 p.m.
On Sat, Dec 24, 2016 at 10:45:40AM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1482601208 25200
> #      Sat Dec 24 10:40:08 2016 -0700
> # Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
> # Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
> tests: make test-convert-git.t reproducible

This appears to have been ninja-queued as 73b1a209b5b8.

>
> For reasons I can't explain, Git's copy detection code was identifying
> different source files on OS X and (presumably) Solaris versus Linux
> (which the test was originally authored against). This was causing
> unstable test output.
>
> Changing the test to use a non-ambiguous source file appears to make
> the test stable.
>
> The test was introduced recently in ea3540e66fd8.
>
> diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
> --- a/tests/test-convert-git.t
> +++ b/tests/test-convert-git.t
> @@ -376,29 +376,40 @@ source, the copy source took the content
>
>  renamelimit config option works
>
>    $ cd git-repo2
> -  $ cp bar bar-copy0
> -  $ echo 0 >> bar-copy0
> -  $ cp bar bar-copy1
> -  $ echo 1 >> bar-copy1
> -  $ git add bar-copy0 bar-copy1
> -  $ commit -a -m 'copy bar 2 times'
> +  $ cat >> copy-source << EOF
> +  > sc0
> +  > sc1
> +  > sc2
> +  > sc3
> +  > sc4
> +  > sc5
> +  > sc6
> +  > EOF
> +  $ git add copy-source
> +  $ commit -m 'add copy-source'
> +  $ cp copy-source source-copy0
> +  $ echo 0 >> source-copy0
> +  $ cp copy-source source-copy1
> +  $ echo 1 >> source-copy1
> +  $ git add source-copy0 source-copy1
> +  $ commit -a -m 'copy copy-source 2 times'
>    $ cd ..
>
>    $ hg -q convert --config convert.git.renamelimit=1 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
>    $ hg -R fullrepo2 status -C --change master
> -  A bar-copy0
> -  A bar-copy1
> +  A source-copy0
> +  A source-copy1
>
>    $ hg -q convert --config convert.git.renamelimit=100 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
>    $ hg -R fullrepo3 status -C --change master
> -  A bar-copy0
> -    bar
> -  A bar-copy1
> -    bar
> +  A source-copy0
> +    copy-source
> +  A source-copy1
> +    copy-source
>
>  test binary conversion (issue1359)
>
>    $ count=19
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - Dec. 24, 2016, 7:47 p.m.
On Sat, Dec 24, 2016 at 02:26:51PM -0500, Augie Fackler wrote:
> On Sat, Dec 24, 2016 at 10:45:40AM -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc@gmail.com>
> > # Date 1482601208 25200
> > #      Sat Dec 24 10:40:08 2016 -0700
> > # Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
> > # Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
> > tests: make test-convert-git.t reproducible
>
> This appears to have been ninja-queued as 73b1a209b5b8.

(sigh, marmoute's email took 2 hours to arrive. I love computers.)
Danek Duvall - Dec. 25, 2016, 4:22 a.m.
Gregory Szorc wrote:

> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1482601208 25200
> #      Sat Dec 24 10:40:08 2016 -0700
> # Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
> # Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
> tests: make test-convert-git.t reproducible
> 
> For reasons I can't explain, Git's copy detection code was identifying
> different source files on OS X and (presumably) Solaris versus Linux
> (which the test was originally authored against). This was causing
> unstable test output.
> 
> Changing the test to use a non-ambiguous source file appears to make
> the test stable.

Just wanted to confirm that this did in fact solve my problem on Solaris.

Thanks,
Danek

Patch

diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -376,29 +376,40 @@  source, the copy source took the content
 
 renamelimit config option works
 
   $ cd git-repo2
-  $ cp bar bar-copy0
-  $ echo 0 >> bar-copy0
-  $ cp bar bar-copy1
-  $ echo 1 >> bar-copy1
-  $ git add bar-copy0 bar-copy1
-  $ commit -a -m 'copy bar 2 times'
+  $ cat >> copy-source << EOF
+  > sc0
+  > sc1
+  > sc2
+  > sc3
+  > sc4
+  > sc5
+  > sc6
+  > EOF
+  $ git add copy-source
+  $ commit -m 'add copy-source'
+  $ cp copy-source source-copy0
+  $ echo 0 >> source-copy0
+  $ cp copy-source source-copy1
+  $ echo 1 >> source-copy1
+  $ git add source-copy0 source-copy1
+  $ commit -a -m 'copy copy-source 2 times'
   $ cd ..
 
   $ hg -q convert --config convert.git.renamelimit=1 \
   > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
   $ hg -R fullrepo2 status -C --change master
-  A bar-copy0
-  A bar-copy1
+  A source-copy0
+  A source-copy1
 
   $ hg -q convert --config convert.git.renamelimit=100 \
   > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
   $ hg -R fullrepo3 status -C --change master
-  A bar-copy0
-    bar
-  A bar-copy1
-    bar
+  A source-copy0
+    copy-source
+  A source-copy1
+    copy-source
 
 test binary conversion (issue1359)
 
   $ count=19