Commit Graph

10 Commits

Author SHA1 Message Date
Jun Wu
063ecdb2bb dumbhttp: use IPv6 if HGIPV6 is set to 1
This will fix flaky tests using dumbhttp.

The patch was tested on gcc112.fsffrance.org using the following command:

  ./run-tests.py -j 40 --runs-per-test 120 test-bundle2-remote-changegroup.t
2017-02-15 21:09:00 -08:00
Yuya Nishihara
dce6c5ba27 server: move cmdutil.service() to new module (API)
And call it runservice() because I'll soon add createservice().

The main reason I'm going to introduce the 'server' module is to solve
future dependency cycle between chgserver.py and commandserver.py.

The 'server' module sits at the same layer as the cmdutil. I believe it's
generally good to get rid of things from the big cmdutil module.
2016-10-15 13:47:43 +09:00
Pulkit Goyal
6b3bc52b40 py3: conditionalize BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer import
The BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer has been merged into
http.server in python 3. All of them has been merged as util.httpserver to use
in both python 2 and 3. This patch adds a regex to check-code to warn against
the use of BaseHTTPServer. Moreover this patch also includes updates to lower
part of test-check-py3-compat.t which used to remain unchanged.
2016-07-13 23:38:29 +05:30
Yuya Nishihara
91097a429b tests: sort import lines in dumbhttp.py
This series is an attempt to enable import-checker.py for tests/**.py, but
it turned out not easy. Since many tests have been ported to absolute_import
without the coverage, import-checker.py reports a lot of errors right now.

Should we enable import-checker.py without fixing all of them so that we
won't get more errors?
2016-04-03 19:40:05 +09:00
Jun Wu
704e54e1c7 serve: accept multiple values for --daemon-postexec
The next patch will add another postexec command: chdir, which can be used
together with unlink. This patch changes the option type of --daemon-postexec
from string to list to accept multiple commands. The error message of invalid
--daemon-postexec value is also changed to include the actual invalid value.
2016-03-09 02:07:40 +00:00
Jun Wu
f5397047b4 serve: rename --daemon-pipefds to --daemon-postexec (BC)
Initially we use --daemon-pipefds to pass file descriptors for synchronization.
Later, in order to support Windows, --daemon-pipefds is changed to accept a
file path to unlink instead. The name is outdated since then.

chg client is designed to use flock, which will be held before starting a
server and until the client actually connects to the server it started. The
unlink synchronization approach is not so helpful in this case.

To address the issues, this patch renames pipefds to postexec and the following
patch will allow the value of --daemon-postexec to be things like
'unlink:/path/to/file' or 'none'.
2016-02-22 16:59:08 +00:00
timeless
329c86706d tests: add execute bit and fix shbang line 2015-12-22 11:05:05 +00:00
Gregory Szorc
f19396fcbe tests/dumbhttp: use absolute_import 2015-12-06 22:12:07 -08:00
Yuya Nishihara
52af4072b1 tests: have dumbhttp.py use cmdutil.service() to wait for child to listen()
Because the original dumbhttp.py exited without waiting for listen(), several
tests could fail with "abort: error: Connection refused" if subsequent hg
command is fast enough.
2014-11-02 13:08:46 +09:00
Mike Hommey
7dcde933f1 tests: pull common http server setup out of individual tests
There are currently two different tests using roughly the same code to
create temporary scripts acting as HTTP servers. As there is going to
be at least one more in an upcoming change, factor those out in a
standalone dumbhttp.py script.
2014-10-16 13:48:51 +09:00