diff tests/test-clone.t @ 30120:932faa29b4c1

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.
author Augie Fackler <augie@google.com>
date Sun, 09 Oct 2016 04:25:22 -0400
parents 1779dde4c9ef
children bbbf6bbbd05f
line wrap: on
line diff
--- a/tests/test-clone.t	Sun Oct 09 17:44:23 2016 +0200
+++ b/tests/test-clone.t	Sun Oct 09 04:25:22 2016 -0400
@@ -1060,7 +1060,12 @@
   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 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log
   (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
   requesting all changes
   adding changesets
@@ -1073,7 +1078,7 @@
   updating working directory
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ cat race2.log
+  $ grep 'existing pooled' race1.log > /dev/null && 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)