tests/test-url-download.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sat, 13 Apr 2024 23:40:28 +0200
changeset 51592 24844407fa0d
parent 50088 2d0daf9c9d5d
permissions -rw-r--r--
perf: clear vfs audit_cache before each run When generating a stream clone, we spend a large amount of time auditing path. Before this changes, the first run was warming the vfs cache for the other runs, leading to a large runtime difference and a "faulty" reported timing for the operation. We now clear this important cache between run to get a more realistic timing. Below are some example of median time change when clearing these cases. The maximum time for a run did not changed significantly. ### data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog # benchmark.name = hg.perf.exchange.stream.generate # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.version = latest no-clearing: 17.289905 cache-clearing: 21.587965 (+24.86%, +4.30) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog no-clearing: 32.670748 cache-clearing: 40.467095 (+23.86%, +7.80) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog no-clearing: 37.838858 cache-clearing: 46.072749 (+21.76%, +8.23) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog no-clearing: 32.969395 cache-clearing: 39.646209 (+20.25%, +6.68) In addition, this significantly reduce the timing difference between the performance command, from the perf extensions and a `real `hg bundle` call producing a stream bundle. Some significant differences remain especially on the "mozilla-try" repositories, but they are now smaller. Note that some of that difference will actually not be attributable to the stream generation (like maybe phases or branch map computation). Below are some benchmarks done on a currently draft changeset fixing some unrelated slowness in `hg bundle` (34a78972af409d1ff37c29e60f6ca811ad1a457d) ### data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default hg.perf.exchange.stream.generate: 21.587965 hg.command.bundle: 24.301799 (+12.57%, +2.71) ## data-env-vars.name = mozilla-central-2024-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 40.467095 hg.command.bundle: 44.831317 (+10.78%, +4.36) ## data-env-vars.name = mozilla-unified-2024-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 39.646209 hg.command.bundle: 45.395258 (+14.50%, +5.75) ## data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog hg.perf.exchange.stream.generate: 46.072749 hg.command.bundle: 55.882608 (+21.29%, +9.81) ## data-env-vars.name = mozilla-try-2023-03-22-zlib-general-delta hg.perf.exchange.stream.generate: 334.716708 hg.command.bundle: 377.856767 (+12.89%, +43.14) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog hg.perf.exchange.stream.generate: 302.972301 hg.command.bundle: 326.098755 (+7.63%, +23.13)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35562
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
#require serve
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     3
  $ hg init server
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     4
  $ hg serve -R server -p $HGPORT -d --pid-file=hg1.pid -E ../error.log
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     5
  $ cat hg1.pid >> $DAEMON_PIDS
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
Check basic fetching
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     8
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
  $ hg debugdownload "http://localhost:$HGPORT/?cmd=lookup&key=tip"
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
  1 0000000000000000000000000000000000000000
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    11
  $ hg debugdownload  -o null.txt "http://localhost:$HGPORT/?cmd=lookup&key=null"
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
  $ cat null.txt
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
  1 0000000000000000000000000000000000000000
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    15
Check the request is made from the usual Mercurial logic
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    16
(rev details, give different content if the request has a Mercurial user agent)
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    17
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    18
  $ get-with-headers.py --headeronly "localhost:$HGPORT" "rev/tip" content-type
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    19
  200 Script output follows
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    20
  content-type: text/html; charset=ascii
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    21
  $ hg debugdownload "http://localhost:$HGPORT/rev/tip"
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    22
  
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    23
  # HG changeset patch
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    24
  # User 
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    25
  # Date 0 0
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    26
  # Node ID 0000000000000000000000000000000000000000
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    27
  
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    28
  
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    29
  
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    30
  
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    31
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    32
Check other kind of compatible url
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    33
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    34
  $ hg debugdownload ./null.txt
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    35
  1 0000000000000000000000000000000000000000
6580cf751418 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    36
46460
8214c71589f6 tests: print the server error log in `test-url-download.t`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35730
diff changeset
    37
  $ cat ../error.log
8214c71589f6 tests: print the server error log in `test-url-download.t`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35730
diff changeset
    38
35564
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    39
Test largefile URL
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    40
------------------
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    41
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    42
  $ cat << EOF >> $HGRCPATH
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    43
  > [extensions]
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    44
  > largefiles=
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    45
  > EOF
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    46
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    47
  $ killdaemons.py
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    48
  $ rm -f error.log hg1.pid
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    49
  $ hg serve -R server -p $HGPORT -d --pid-file=hg1.pid -E error.log
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    50
  $ cat hg1.pid >> $DAEMON_PIDS
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    51
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    52
  $ hg -R server debuglfput null.txt
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    53
  a57b57b39ee4dc3da1e03526596007f480ecdbe8
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    54
50088
2d0daf9c9d5d tests: remove unnecessary --traceback argument
Dan Villiom Podlaski Christiansen <dan.villiom.podlaski.christiansen@sallinggroup.com>
parents: 46460
diff changeset
    55
  $ hg debugdownload "largefile://a57b57b39ee4dc3da1e03526596007f480ecdbe8" --config paths.default=http://localhost:$HGPORT/
35564
cf841f2b5a72 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net>
parents: 35562
diff changeset
    56
  1 0000000000000000000000000000000000000000
35730
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    57
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    58
from within a repository
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    59
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    60
  $ hg clone http://localhost:$HGPORT/ client
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    61
  no changes found
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    62
  updating to branch default
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    63
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    64
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    65
  $ cd client
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    66
  $ hg path
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    67
  default = http://localhost:$HGPORT/
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    68
  $ hg debugdownload "largefile://a57b57b39ee4dc3da1e03526596007f480ecdbe8"
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    69
  1 0000000000000000000000000000000000000000
05d415790761 debugdownload: read repository hgrc if there is one
Boris Feld <boris.feld@octobus.net>
parents: 35564
diff changeset
    70
  $ cd ..
46460
8214c71589f6 tests: print the server error log in `test-url-download.t`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35730
diff changeset
    71
8214c71589f6 tests: print the server error log in `test-url-download.t`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35730
diff changeset
    72
  $ cat error.log