[PATCH] run-tests: use different chg socket directories for different tests

Yuya Nishihara yuya at tcha.org
Wed Mar 23 10:22:29 EDT 2016


On Sun, 20 Mar 2016 17:43:21 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1458519486 25200
> #      Sun Mar 20 17:18:06 2016 -0700
> # Node ID ccac69466d6b729fa09a35d7ee690a36735c48b6
> # Parent  83127a9fe76ea8b9379d9efa3afefff075b4f920
> run-tests: use different chg socket directories for different tests
> 
> Before this patch, if --chg or --with-chg is specified, all tests are using
> a same chgserver socket. Since the chg client holds a lock when it starts a
> new server, and every test needs at least a new chg server due to different
> HGRCPATH affecting the confighash. The result is a lot of tests will be
> timed out if -j is large (for example, 50 or 100).

(FYI, last time "-j4 --chg" ran out 8GB memory on my laptop.)

> @@ -532,6 +532,7 @@
>          self._py3kwarnings = py3kwarnings
>          self._shell = _bytespath(shell)
>          self._hgcommand = hgcommand or b'hg'
> +        self._usechg = usechg

It seems the Test class initializes all variables at __init__. We should
do the same for self._chgsockdir.

> @@ -733,6 +739,10 @@
>          else:
>              shutil.rmtree(self._testtmp, True)
>              shutil.rmtree(self._threadtmp, True)
> +            if self._usechg:
> +                # chgservers will stop automatically after they find the socket
> +                # files are deleted
> +                shutil.rmtree(self._chgsockdir, True)

The servers should stop even if --keep-tmpdir is on.


More information about the Mercurial-devel mailing list