Patchwork [1,of,2] test-clone: fix some instability in pooled clone race condition test

login
register
mail settings
Submitter Augie Fackler
Date Oct. 9, 2016, 8:42 a.m.
Message ID <eb00b5d08443c5a5cef9.1476002576@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/16971/
State Superseded
Headers show

Comments

Augie Fackler - Oct. 9, 2016, 8:42 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1476001522 14400
#      Sun Oct 09 04:25:22 2016 -0400
# Node ID eb00b5d08443c5a5cef981c25def007685ed1fe6
# Parent  67b0484c9ce4960b67aa634f097c4d833e1d034a
test-clone: fix some instability in pooled clone race condition test

Healthy output (one log file mentioning "existing pooled" and one
mentioning "new pooled") will now print in a stable order, but
unhealthy output will print some sort of error.

This reduces the flakiness of the test from 55% to 38%. My next patch
makes it completely stable.
Augie Fackler - Oct. 9, 2016, 8:54 a.m.
\sadtrombone{I forgot to run check-code, will re-send with check-code happy}

(In other words: drop these patches for now, sorry for the noise)

> On Oct 9, 2016, at 10:42, Augie Fackler <raf@durin42.com> wrote:
> 
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1476001522 14400
> #      Sun Oct 09 04:25:22 2016 -0400
> # Node ID eb00b5d08443c5a5cef981c25def007685ed1fe6
> # Parent  67b0484c9ce4960b67aa634f097c4d833e1d034a
> test-clone: fix some instability in pooled clone race condition test
> 
> Healthy output (one log file mentioning "existing pooled" and one
> mentioning "new pooled") will now print in a stable order, but
> unhealthy output will print some sort of error.
> 
> This reduces the flakiness of the test from 55% to 38%. My next patch
> makes it completely stable.
> 
> diff --git a/tests/test-clone.t b/tests/test-clone.t
> --- a/tests/test-clone.t
> +++ b/tests/test-clone.t
> @@ -1060,7 +1060,12 @@ Cloning into pooled storage doesn't race
>   date:        Thu Jan 01 00:00:00 1970 +0000
>   summary:     1a
> 
> -  $ cat race1.log
> +One repo should be new, the other should be shared from the pool. We
> +don't care which is which, so we just make sure we always print the
> +one containing "new pooled" first, then one one containing "existing
> +pooled".
> +
> +  $ grep -q 'new pooled' race1.log && cat race1.log || cat race2.log
>   (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
>   requesting all changes
>   adding changesets
> @@ -1073,7 +1078,7 @@ Cloning into pooled storage doesn't race
>   updating working directory
>   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> 
> -  $ cat race2.log
> +  $ grep -q 'existing pooled' race1.log && cat race1.log || cat race2.log
>   (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
>   waiting for lock on repository share-destrace2 held by * (glob)
>   got lock after \d+ seconds (re)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -1060,7 +1060,12 @@  Cloning into pooled storage doesn't race
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     1a
   
-  $ cat race1.log
+One repo should be new, the other should be shared from the pool. We
+don't care which is which, so we just make sure we always print the
+one containing "new pooled" first, then one one containing "existing
+pooled".
+
+  $ grep -q 'new pooled' race1.log && cat race1.log || cat race2.log
   (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
   requesting all changes
   adding changesets
@@ -1073,7 +1078,7 @@  Cloning into pooled storage doesn't race
   updating working directory
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ cat race2.log
+  $ grep -q 'existing pooled' race1.log && cat race1.log || cat race2.log
   (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
   waiting for lock on repository share-destrace2 held by * (glob)
   got lock after \d+ seconds (re)