Mercurial > public > mercurial-scm > hg-stable
diff tests/test-http-bad-server.t @ 39738:4bd6e444c76f
bundle2: make server.bundle2.stream default to True
Support for bundle2 streaming clones has been shipped in Mercurial 4.5
(7eedbd5d4880), but was never activated by default. It's time to have more
people use it. The new format allows streaming clones to transport cache
(hooray for speed) and phaseroots (fixes phase-related issues).
Changes in tests:
bundle2 capabilities now have "stream=v2" (plus a '\n' as a separator) and
therefore take 14 bytes more: "%0Astream%3Dv2". Tip for tests that have data
encoded with CBOR: 0xd3 - 0xc5 = 14.
$USUAL_BUNDLE2_CAPS$ replaces $USUAL_BUNDLE2_CAPS_SERVER$, which is the same
thing, but without "stream=v2".
Since streaming clones now also transfer caches, the reported byte and file
counts are higher (e.g. 816 bytes in 9 files instead of 613 bytes in 4 files,
a bit of --debug and manual math confirms that the caches take these extra 203
bytes in 5 files).
Differential Revision: https://phab.mercurial-scm.org/D4680
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 17 Sep 2018 17:47:24 +0800 |
parents | 98995b689e03 |
children | 21f5810df848 8695fbe17f7c |
line wrap: on
line diff
--- a/tests/test-http-bad-server.t Mon Sep 17 16:52:34 2018 +0800 +++ b/tests/test-http-bad-server.t Mon Sep 17 17:47:24 2018 +0800 @@ -118,9 +118,9 @@ write(23) -> Server: badhttpserver\r\n write(37) -> Date: $HTTP_DATE$\r\n write(41) -> Content-Type: application/mercurial-0.1\r\n - write(21) -> Content-Length: 436\r\n + write(21) -> Content-Length: 450\r\n write(2) -> \r\n - write(436) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(450) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(4? from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob) readline(1? from -1) -> (1?) Accept-Encoding* (glob) read limit reached; closing socket @@ -159,9 +159,9 @@ write(23) -> Server: badhttpserver\r\n write(37) -> Date: $HTTP_DATE$\r\n write(41) -> Content-Type: application/mercurial-0.1\r\n - write(21) -> Content-Length: 436\r\n + write(21) -> Content-Length: 450\r\n write(2) -> \r\n - write(436) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(450) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(13? from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob) readline(1?? from -1) -> (27) Accept-Encoding: identity\r\n (glob) readline(8? from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob) @@ -216,9 +216,9 @@ write(23) -> Server: badhttpserver\r\n write(37) -> Date: $HTTP_DATE$\r\n write(41) -> Content-Type: application/mercurial-0.1\r\n - write(21) -> Content-Length: 449\r\n + write(21) -> Content-Length: 463\r\n write(2) -> \r\n - write(449) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(463) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(1?? from 65537) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob) readline(1?? from -1) -> (27) Accept-Encoding: identity\r\n (glob) readline(1?? from -1) -> (41) content-type: application/mercurial-0.1\r\n (glob) @@ -275,7 +275,7 @@ $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone - abort: HTTP request error (incomplete response; expected 436 bytes got 20) + abort: HTTP request error (incomplete response; expected 450 bytes got 20) (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator) [255] @@ -292,16 +292,16 @@ write(23 from 23) -> (121) Server: badhttpserver\r\n write(37 from 37) -> (84) Date: $HTTP_DATE$\r\n write(41 from 41) -> (43) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (22) Content-Length: 436\r\n + write(21 from 21) -> (22) Content-Length: 450\r\n write(2 from 2) -> (20) \r\n - write(20 from 436) -> (0) batch branchmap bund + write(20 from 450) -> (0) batch branchmap bund write limit reached; closing socket $ rm -f error.log Server sends incomplete headers for batch request - $ hg serve --config badserver.closeaftersendbytes=714 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=728 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS TODO this output is horrible @@ -323,13 +323,13 @@ readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n readline(-1) -> (2) \r\n - write(36 from 36) -> (678) HTTP/1.1 200 Script output follows\r\n - write(23 from 23) -> (655) Server: badhttpserver\r\n - write(37 from 37) -> (618) Date: $HTTP_DATE$\r\n - write(41 from 41) -> (577) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (556) Content-Length: 436\r\n - write(2 from 2) -> (554) \r\n - write(436 from 436) -> (118) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(36 from 36) -> (692) HTTP/1.1 200 Script output follows\r\n + write(23 from 23) -> (669) Server: badhttpserver\r\n + write(37 from 37) -> (632) Date: $HTTP_DATE$\r\n + write(41 from 41) -> (591) Content-Type: application/mercurial-0.1\r\n + write(21 from 21) -> (570) Content-Length: 450\r\n + write(2 from 2) -> (568) \r\n + write(450 from 450) -> (118) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -350,7 +350,7 @@ Server sends an incomplete HTTP response body to batch request - $ hg serve --config badserver.closeaftersendbytes=779 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=793 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS TODO client spews a stack due to uncaught ValueError in batch.results() @@ -371,13 +371,13 @@ readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n readline(-1) -> (2) \r\n - write(36 from 36) -> (743) HTTP/1.1 200 Script output follows\r\n - write(23 from 23) -> (720) Server: badhttpserver\r\n - write(37 from 37) -> (683) Date: $HTTP_DATE$\r\n - write(41 from 41) -> (642) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (621) Content-Length: 436\r\n - write(2 from 2) -> (619) \r\n - write(436 from 436) -> (183) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(36 from 36) -> (757) HTTP/1.1 200 Script output follows\r\n + write(23 from 23) -> (734) Server: badhttpserver\r\n + write(37 from 37) -> (697) Date: $HTTP_DATE$\r\n + write(41 from 41) -> (656) Content-Type: application/mercurial-0.1\r\n + write(21 from 21) -> (635) Content-Length: 450\r\n + write(2 from 2) -> (633) \r\n + write(450 from 450) -> (183) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -400,7 +400,7 @@ Server sends incomplete headers for getbundle response - $ hg serve --config badserver.closeaftersendbytes=926 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=940 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS TODO this output is terrible @@ -423,13 +423,13 @@ readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n readline(-1) -> (2) \r\n - write(36 from 36) -> (890) HTTP/1.1 200 Script output follows\r\n - write(23 from 23) -> (867) Server: badhttpserver\r\n - write(37 from 37) -> (830) Date: $HTTP_DATE$\r\n - write(41 from 41) -> (789) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (768) Content-Length: 436\r\n - write(2 from 2) -> (766) \r\n - write(436 from 436) -> (330) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(36 from 36) -> (904) HTTP/1.1 200 Script output follows\r\n + write(23 from 23) -> (881) Server: badhttpserver\r\n + write(37 from 37) -> (844) Date: $HTTP_DATE$\r\n + write(41 from 41) -> (803) Content-Type: application/mercurial-0.1\r\n + write(21 from 21) -> (782) Content-Length: 450\r\n + write(2 from 2) -> (780) \r\n + write(450 from 450) -> (330) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -466,7 +466,7 @@ Server stops before it sends transfer encoding - $ hg serve --config badserver.closeaftersendbytes=959 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=973 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -486,7 +486,7 @@ Server sends empty HTTP body for getbundle - $ hg serve --config badserver.closeaftersendbytes=964 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=978 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -504,13 +504,13 @@ readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n readline(-1) -> (2) \r\n - write(36 from 36) -> (928) HTTP/1.1 200 Script output follows\r\n - write(23 from 23) -> (905) Server: badhttpserver\r\n - write(37 from 37) -> (868) Date: $HTTP_DATE$\r\n - write(41 from 41) -> (827) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (806) Content-Length: 436\r\n - write(2 from 2) -> (804) \r\n - write(436 from 436) -> (368) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(36 from 36) -> (942) HTTP/1.1 200 Script output follows\r\n + write(23 from 23) -> (919) Server: badhttpserver\r\n + write(37 from 37) -> (882) Date: $HTTP_DATE$\r\n + write(41 from 41) -> (841) Content-Type: application/mercurial-0.1\r\n + write(21 from 21) -> (820) Content-Length: 450\r\n + write(2 from 2) -> (818) \r\n + write(450 from 450) -> (368) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -549,7 +549,7 @@ Server sends partial compression string - $ hg serve --config badserver.closeaftersendbytes=988 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1002 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -567,13 +567,13 @@ readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n readline(-1) -> (2) \r\n - write(36 from 36) -> (952) HTTP/1.1 200 Script output follows\r\n - write(23 from 23) -> (929) Server: badhttpserver\r\n - write(37 from 37) -> (892) Date: $HTTP_DATE$\r\n - write(41 from 41) -> (851) Content-Type: application/mercurial-0.1\r\n - write(21 from 21) -> (830) Content-Length: 436\r\n - write(2 from 2) -> (828) \r\n - write(436 from 436) -> (392) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(36 from 36) -> (966) HTTP/1.1 200 Script output follows\r\n + write(23 from 23) -> (943) Server: badhttpserver\r\n + write(37 from 37) -> (906) Date: $HTTP_DATE$\r\n + write(41 from 41) -> (865) Content-Type: application/mercurial-0.1\r\n + write(21 from 21) -> (844) Content-Length: 450\r\n + write(2 from 2) -> (842) \r\n + write(450 from 450) -> (392) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -615,7 +615,7 @@ Server sends partial bundle2 header magic - $ hg serve --config badserver.closeaftersendbytes=985 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=999 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -639,7 +639,7 @@ Server sends incomplete bundle2 stream params length - $ hg serve --config badserver.closeaftersendbytes=994 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1008 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -664,7 +664,7 @@ Servers stops after bundle2 stream params header - $ hg serve --config badserver.closeaftersendbytes=997 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1011 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -689,7 +689,7 @@ Server stops sending after bundle2 part header length - $ hg serve --config badserver.closeaftersendbytes=1006 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1020 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -715,7 +715,7 @@ Server stops sending after bundle2 part header - $ hg serve --config badserver.closeaftersendbytes=1053 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1067 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -745,7 +745,7 @@ Server stops after bundle2 part payload chunk size - $ hg serve --config badserver.closeaftersendbytes=1074 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1088 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -776,7 +776,7 @@ Server stops sending in middle of bundle2 payload chunk - $ hg serve --config badserver.closeaftersendbytes=1535 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1549 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -808,7 +808,7 @@ Server stops sending after 0 length payload chunk size - $ hg serve --config badserver.closeaftersendbytes=1566 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1580 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -845,8 +845,8 @@ Server stops sending after 0 part bundle part header (indicating end of bundle2 payload) This is before the 0 size chunked transfer part that signals end of HTTP response. -# $ hg serve --config badserver.closeaftersendbytes=1741 -p $HGPORT -d --pid-file=hg.pid -E error.log - $ hg serve --config badserver.closeaftersendbytes=1848 -p $HGPORT -d --pid-file=hg.pid -E error.log +# $ hg serve --config badserver.closeaftersendbytes=1755 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1862 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone @@ -890,7 +890,7 @@ Server sends a size 0 chunked-transfer size without terminating \r\n - $ hg serve --config badserver.closeaftersendbytes=1851 -p $HGPORT -d --pid-file=hg.pid -E error.log + $ hg serve --config badserver.closeaftersendbytes=1865 -p $HGPORT -d --pid-file=hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ clone