changeset 25442:9ee395dffac9

test: pull through http when testing for race conditions The http server is stateless giving more occasion for race. We switch the test to http before adding extra cases tests.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 01 Jun 2015 17:47:15 -0700
parents 58b766a21189
children 443d3decbdde
files tests/test-bookmarks-pushpull.t
diffstat 1 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-bookmarks-pushpull.t	Mon Jun 01 17:54:29 2015 -0700
+++ b/tests/test-bookmarks-pushpull.t	Mon Jun 01 17:47:15 2015 -0700
@@ -263,7 +263,14 @@
 
   $ cd ..
   $ hg clone -q a pull-race
-  $ hg clone -q pull-race pull-race2
+
+We want to use http because it is stateless and therefore more susceptible to
+race conditions
+
+  $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
+  $ cat pull-race.pid >> $DAEMON_PIDS
+
+  $ hg clone -q http://localhost:$HGPORT/ pull-race2
   $ cd pull-race
   $ hg up -q Y
   $ echo c4 > f2
@@ -273,17 +280,22 @@
   > [hooks]
   > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
   > EOF
-  $ cd ../pull-race2
+
+(new config needs a server restart)
+
+  $ cd ..
+  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
+  $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
+  $ cat pull-race.pid >> $DAEMON_PIDS
+  $ cd pull-race2
   $ hg -R $TESTTMP/pull-race book
      @                         1:0d2164f0ce0d
      X                         1:0d2164f0ce0d
    * Y                         4:b0a5eff05604
      Z                         1:0d2164f0ce0d
   $ hg pull
-  pulling from $TESTTMP/pull-race (glob)
+  pulling from http://localhost:$HGPORT/
   searching for changes
-  adding f3
-  committed in pull-race
   adding changesets
   adding manifests
   adding file changes
@@ -295,6 +307,10 @@
      X                         1:0d2164f0ce0d
      Y                         4:b0a5eff05604
      Z                         1:0d2164f0ce0d
+
+(done with this section of the test)
+
+  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   $ cd ../b
 
 diverging a remote bookmark fails