test: pull through http when testing for race conditions
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 01 Jun 2015 17:47:15 -0700
changeset 25442 9ee395dffac9
parent 25441 58b766a21189
child 25443 443d3decbdde
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.
tests/test-bookmarks-pushpull.t
--- 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