tests/test-clone-cgi.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 09 Apr 2024 02:54:19 +0200
changeset 51586 1cef1412af3e
parent 50734 d5cd1fd690f3
permissions -rw-r--r--
phases: rework the logic of _pushdiscoveryphase to bound complexity This rework the various graph traversal in _pushdiscoveryphase to keep the complexity in check. This is done though a couple of things: - first, limiting the space we have to explore, for example, if we are not in publishing push, we don't need to consider remote draft roots that are also draft locally, as there is nothing to be moved there. - avoid unbounded descendant computation, and use the faster "rev between" computation. This provide a massive boost to performance when exchanging with repository with a massive amount of draft, like mozilla-try: ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.command.push # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.reuse-external-delta-parent = default ## benchmark.variants.revs = any-1-extra-rev before: 20.346590 seconds after: 11.232059 seconds (-38.15%, -7.48 seconds) ## benchmark.variants.revs = any-100-extra-rev before: 24.752051 seconds after: 15.367412 seconds (-37.91%, -9.38 seconds) After this changes, the push operation is still quite too slow. Some of this can be attributed to general phases slowness (reading all the roots from disk for example) and other know slowness (not using persistent-nodemap, branchmap, tags, etc. We are also working on them, but with this series, phase discovery during push no longer showing up in profile and this is a pretty nice and bit low-hanging fruit out of the way. ### (same case as the above) # benchmark.variants.revs = any-1-extra-rev pre-%ln-change: 44.235070 this-changeset: 11.232059 seconds (-74.61%, -33.00 seconds) # benchmark.variants.revs = any-100-extra-rev pre-%ln-change: 49.234697 this-changeset: 15.367412 seconds (-68.79%, -33.87 seconds) Note that with this change, the `hg push` performance is now much closer to the `hg pull` performance, even it still lagging behind a bit. (and the overall performance are still too slow). ### data-env-vars.name = mozilla-try-2023-03-22-ds2-pnm # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.pulled-delta-reuse-policy = default # bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 6.517450 hg.command.push: 11.219888 ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 10.160991 hg.command.push: 14.251107 ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # bin-env-vars.hg.py-re2-module = default # benchmark.variants.explicit-rev = all-out-heads # benchmark.variants.issue6528 = disabled # benchmark.variants.protocol = ssh # benchmark.variants.pulled-delta-reuse-policy = default ## bin-env-vars.hg.flavor = default ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 8.577772 hg.command.push: 11.232059 ## bin-env-vars.hg.flavor = default ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 13.152976 hg.command.push: 15.367412 ## bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-1-extra-rev hg.command.pull: 8.731982 hg.command.push: 11.178751 ## bin-env-vars.hg.flavor = rust ## benchmark.variants.revs = any-100-extra-rev hg.command.pull: 13.184236 hg.command.push: 15.620843
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 18552
diff changeset
     1
#require no-msys # MSYS will translate web paths as if they were file paths
15567
8b84d040d9f9 tests: introduce 'hghave msys' to skip tests that would fail because of msys
Mads Kiilerich <mads@kiilerich.com>
parents: 13269
diff changeset
     2
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     3
This is a test of the wire protocol over CGI-based hgweb.
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     4
initialize repository
6922
1ec2d227a521 hgweb: fix WSGI iterators handling in CGI adapter (issue1254)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     5
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     6
  $ hg init test
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     7
  $ cd test
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     8
  $ echo a > a
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
     9
  $ hg ci -Ama
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    10
  adding a
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    11
  $ cd ..
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    12
  $ cat >hgweb.cgi <<HGWEB
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    13
  > #
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    14
  > # An example CGI script to use hgweb, edit as necessary
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    15
  > from mercurial import demandimport; demandimport.enable()
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    16
  > from mercurial.hgweb import hgweb
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    17
  > from mercurial.hgweb import wsgicgi
37668
2a42ca2679e2 py3: add b'' prefixes to make values bytes
Pulkit Goyal <7895pulkit@gmail.com>
parents: 33262
diff changeset
    18
  > application = hgweb(b"test", b"Empty test repository")
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    19
  > wsgicgi.launch(application)
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    20
  > HGWEB
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    21
  $ chmod 755 hgweb.cgi
6922
1ec2d227a521 hgweb: fix WSGI iterators handling in CGI adapter (issue1254)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    22
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    23
try hgweb request
6922
1ec2d227a521 hgweb: fix WSGI iterators handling in CGI adapter (issue1254)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    24
13269
aa3f726a2bdb tests: remove duplication of the CGI environment variables
StevenGBrown
parents: 12410
diff changeset
    25
  $ . "$TESTDIR/cgienv"
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    26
  $ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37668
diff changeset
    27
  $ "$PYTHON" hgweb.cgi >page1 2>&1
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37668
diff changeset
    28
  $ "$PYTHON" "$TESTDIR/md5sum.py" page1
12410
2bfb335c7594 tests: unify test-clone-cgi
Matt Mackall <mpm@selenic.com>
parents: 11584
diff changeset
    29
  1f424bb22ec05c3c6bc866b6e67efe43  page1
18552
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    30
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    31
make sure headers are sent even when there is no body
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    32
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 37668
diff changeset
    33
  $ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" "$PYTHON" hgweb.cgi
18552
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    34
  Status: 200 Script output follows\r (esc)
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    35
  Content-Type: application/mercurial-0.1\r (esc)
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    36
  Content-Length: 0\r (esc)
e8efcc8ff5c0 hgweb.cgi: fix internal WSGI emulation (issue3804)
Mads Kiilerich <madski@unity3d.com>
parents: 15567
diff changeset
    37
  \r (esc)