tests/test-http-bad-server.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 21 Feb 2022 11:09:30 -0700
changeset 48922 fe056166b40d
parent 48874 af0b21d5a930
child 49248 63fd0282ad40
permissions -rw-r--r--
dirstate: remove pycompat.iteritems() Differential Revision: https://phab.mercurial-scm.org/D12327
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37845
b4b7427b5786 tests: remove #require killdaemons
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
     1
#require serve zstd
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
Client version is embedded in HTTP request and is effectively dynamic. Pin the
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
version so behavior is deterministic.
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  $ cat > fakeversion.py << EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > from mercurial import util
40982
c296b8faa926 py3: byteify the fakeversion extension in test-http-bad-server.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 40973
diff changeset
     8
  > util.version = lambda: b'4.2'
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  $ cat >> $HGRCPATH << EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  > [extensions]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  > fakeversion = `pwd`/fakeversion.py
40886
8aa7879adacf test: explicitly disable sparse-revlog in test-http-bad-server.t
Boris Feld <boris.feld@octobus.net>
parents: 40881
diff changeset
    14
  > [format]
8aa7879adacf test: explicitly disable sparse-revlog in test-http-bad-server.t
Boris Feld <boris.feld@octobus.net>
parents: 40881
diff changeset
    15
  > sparse-revlog = no
46876
a8fa270a0e86 persistent-nodemap: disable it unconditionally for test-http-bad-server.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
    16
  > use-persistent-nodemap = no
34322
10e162bb9bf5 pull: use 'phase-heads' to retrieve phase information
Boris Feld <boris.feld@octobus.net>
parents: 34308
diff changeset
    17
  > [devel]
10e162bb9bf5 pull: use 'phase-heads' to retrieve phase information
Boris Feld <boris.feld@octobus.net>
parents: 34308
diff changeset
    18
  > legacy.exchange = phases
44412
edc8504bc26b exchange: turn on option that makes concurrent pushes work better
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42897
diff changeset
    19
  > [server]
edc8504bc26b exchange: turn on option that makes concurrent pushes work better
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 42897
diff changeset
    20
  > concurrent-push-mode = strict
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  > EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  $ hg init server0
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  $ cd server0
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  $ touch foo
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ hg -q commit -A -m initial
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
Also disable compression because zstd is optional and causes output to vary
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
and because debugging partial responses is hard when compression is involved
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  $ cat > .hg/hgrc << EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  > [extensions]
48605
089cb4d6af5a test-http-bad-server: move the extension in `testlib`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46876
diff changeset
    33
  > badserver = $TESTDIR/testlib/badserverext.py
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
  > [server]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
  > compressionengines = none
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
  > EOF
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
Failure to accept() socket should result in connection related error message
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
    39
----------------------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
48606
ee1235afda4b test-http-bad-server: rename config to use `-`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48605
diff changeset
    41
  $ hg serve --config badserver.close-before-accept=true -p $HGPORT -d --pid-file=hg.pid
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
  $ hg clone http://localhost:$HGPORT/ clone
40973
97484e1d1834 tests: followup on network related errors on Debian 9
Boris Feld <boris.feld@octobus.net>
parents: 40936
diff changeset
    45
  abort: error: (\$ECONNRESET\$|\$EADDRNOTAVAIL\$) (re)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
    46
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
(The server exits on its own, but there is a race between that and starting a new server.
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
So ensure the process is dead.)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
Failure immediately after accept() should yield connection related error message
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
    54
--------------------------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
48606
ee1235afda4b test-http-bad-server: rename config to use `-`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48605
diff changeset
    56
  $ hg serve --config badserver.close-after-accept=true -p $HGPORT -d --pid-file=hg.pid
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
32064
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    59
TODO: this usually outputs good results, but sometimes emits abort:
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    60
error: '' on FreeBSD and OS X.
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    61
What we ideally want are:
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    62
35232
a037b6647d8c tests: add a substitution for ECONNRESET/WSAECONNRESET messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 35074
diff changeset
    63
abort: error: $ECONNRESET$
32064
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    64
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    65
The flakiness in this output was observable easily with
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    66
--runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
  $ hg clone http://localhost:$HGPORT/ clone
32064
f82cdd5ee57e tests: work around flaky test failure on FreeBSD and relatives
Augie Fackler <augie@google.com>
parents: 32024
diff changeset
    68
  abort: error: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
    69
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
Failure to read all bytes in initial HTTP request should yield connection related error message
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
    74
-----------------------------------------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
48606
ee1235afda4b test-http-bad-server: rename config to use `-`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48605
diff changeset
    76
  $ hg serve --config badserver.close-after-recv-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  $ hg clone http://localhost:$HGPORT/ clone
40926
21f5810df848 test: fix test-http-bad-server with current python 2.7
Julien Cristau <jcristau@mozilla.com>
parents: 39722
diff changeset
    80
  abort: error: bad HTTP status line: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
    81
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
  $ cat error.log
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
    86
  readline(1 from ~) -> (1) G
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
  read limit reached; closing socket
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
Same failure, but server reads full HTTP request line
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
    92
-----------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
48638
1ae83cafaa39 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48636
diff changeset
    94
  $ hg serve \
1ae83cafaa39 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48636
diff changeset
    95
  > --config badserver.close-after-recv-patterns="GET /\?cmd=capabilities" \
1ae83cafaa39 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48636
diff changeset
    96
  > --config badserver.close-after-recv-bytes=7 \
1ae83cafaa39 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48636
diff changeset
    97
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
  $ hg clone http://localhost:$HGPORT/ clone
40926
21f5810df848 test: fix test-http-bad-server with current python 2.7
Julien Cristau <jcristau@mozilla.com>
parents: 39722
diff changeset
   100
  abort: error: bad HTTP status line: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
   101
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
  $ cat error.log
48638
1ae83cafaa39 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48636
diff changeset
   106
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   107
  readline(7 from *) -> (7) Accept- (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
  read limit reached; closing socket
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
Failure on subsequent HTTP request on the same socket (cmd?batch)
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   113
-----------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
48639
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   115
  $ hg serve \
48640
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   116
  > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,GET /\?cmd=batch" \
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   117
  > --config badserver.close-after-recv-bytes=15,197 \
48639
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   118
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   120
  $ hg clone http://localhost:$HGPORT/ clone
40926
21f5810df848 test: fix test-http-bad-server with current python 2.7
Julien Cristau <jcristau@mozilla.com>
parents: 39722
diff changeset
   121
  abort: error: bad HTTP status line: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
   122
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
  $ cat error.log
48639
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   127
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   128
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   129
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   130
  readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   131
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   132
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   133
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   134
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   135
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   136
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48639
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   137
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
ebd515d129c6 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48638
diff changeset
   138
  readline(*) -> (1?) Accept-Encoding* (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
  read limit reached; closing socket
48640
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   140
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   141
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   142
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   143
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   144
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
316b912c47f5 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48639
diff changeset
   145
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   146
  readline(4 from *) -> (4) host (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   147
  read limit reached; closing socket
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   148
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   150
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
Failure to read getbundle HTTP request
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   152
--------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   154
  $ hg serve \
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   155
  > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,user-agent: mercurial/proto-1.0,GET /\?cmd=getbundle" \
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   156
  > --config badserver.close-after-recv-bytes=110,26,274 \
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   157
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   160
  requesting all changes
40926
21f5810df848 test: fix test-http-bad-server with current python 2.7
Julien Cristau <jcristau@mozilla.com>
parents: 39722
diff changeset
   161
  abort: error: bad HTTP status line: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
   162
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  $ cat error.log
35268
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
   167
  readline(1 from -1) -> (1) x (?)
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
   168
  readline(1 from -1) -> (1) x (?)
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   169
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   170
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   171
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   172
  readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   173
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   174
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   175
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   176
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   177
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   178
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   179
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   180
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   181
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   182
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   183
  readline(*) -> (1?) x-hgproto-1:* (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   184
  read limit reached; closing socket
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   185
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   186
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   187
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   188
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   189
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   190
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   191
  readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   192
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   193
  readline(*) -> (2) \r\n (glob)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   194
  sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   195
  sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   196
  write(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py3 no-py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   197
  write(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py3 no-py36 !)
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   198
  readline(24 from ~) -> (*) GET /?cmd=getbundle HTTP* (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   199
  read limit reached; closing socket
48641
36a41521ed57 test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48640
diff changeset
   200
  readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   201
  readline(274 from *) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   202
  readline(247 from *) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   203
  readline(218 from *) -> (218) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtag (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
  read limit reached; closing socket
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   205
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   206
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   207
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   208
Now do a variation using POST to send arguments
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   209
===============================================
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   210
48642
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   211
  $ hg serve \
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   212
  > --config badserver.close-after-recv-patterns="x-hgargs-post:,user-agent: mercurial/proto-1.0" \
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   213
  > --config badserver.close-after-recv-bytes="14,26" \
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   214
  > --config experimental.httppostargs=true \
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   215
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   216
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   217
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   218
  $ hg clone http://localhost:$HGPORT/ clone
40926
21f5810df848 test: fix test-http-bad-server with current python 2.7
Julien Cristau <jcristau@mozilla.com>
parents: 39722
diff changeset
   219
  abort: error: bad HTTP status line: * (glob)
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
   220
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   221
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   222
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   223
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   224
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48642
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   225
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   226
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   227
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   228
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   229
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   230
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   231
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   232
  sendall(*) -> 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=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   233
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   234
  write(*) -> 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=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48642
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   235
  readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   236
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   237
  readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   238
  readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   239
  readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   240
  readline(*) -> (1?) x-hgproto-1: * (glob)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   241
  read limit reached; closing socket
48642
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   242
  readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   243
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   244
  readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   245
  readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   246
  readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   247
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   248
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   249
  readline(*) -> (20) content-length: 28\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   250
  readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   251
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   252
  readline(*) -> (2) \r\n (glob)
009e86022a9d test-http-bad-server: use the new pattern-reading for a test-case
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48641
diff changeset
   253
  read(24 from 28) -> (*) cmds=* (glob)
48608
f87b632406a9 test-http-bad-server: align output by using `;`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48607
diff changeset
   254
  read limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   255
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   256
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   257
  Exception: connection closed after receiving N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   258
  
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   259
  write(126) -> HTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   260
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   261
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   262
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   263
Now move on to partial server responses
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   264
=======================================
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   265
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   266
Server sends a single character from the HTTP response line
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   267
-----------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   268
48606
ee1235afda4b test-http-bad-server: rename config to use `-`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48605
diff changeset
   269
  $ hg serve --config badserver.close-after-send-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   270
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   271
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   272
  $ hg clone http://localhost:$HGPORT/ clone
34308
9bd003052d55 keepalive: add more context to bad status line errors
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32319
diff changeset
   273
  abort: error: bad HTTP status line: H
45839
ebee234d952a errors: set detailed exit code to 100 for some remote errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
   274
  [100]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   275
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   276
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   277
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   278
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   279
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   280
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   281
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   282
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   283
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   284
  readline(*) -> (2) \r\n (glob)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   285
  sendall(1 from 160) -> (0) H (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   286
  write(1 from 160) -> (0) H (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   287
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   288
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   289
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   290
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   291
  
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   292
  write(286) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (glob) (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   293
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   294
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   295
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   296
Server sends an incomplete capabilities response body
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   297
-----------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   298
48619
e5313a1e0a26 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48615
diff changeset
   299
  $ hg serve \
e5313a1e0a26 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48615
diff changeset
   300
  > --config badserver.close-after-send-patterns='batch branchmap bund' \
e5313a1e0a26 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48615
diff changeset
   301
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   302
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   303
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   304
  $ hg clone http://localhost:$HGPORT/ clone
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   305
  abort: HTTP request error (incomplete response; expected * bytes got 20) (glob)
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   306
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   307
  [255]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   308
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   309
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   310
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   311
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   312
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   313
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   314
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   315
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   316
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   317
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   318
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   319
  sendall(20 from *) -> (0) batch branchmap bund (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   320
  write(160) -> (20) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   321
  write(20 from *) -> (0) batch branchmap bund (glob) (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   322
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   323
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   324
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   325
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   326
  
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   327
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   328
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   329
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   330
Server sends incomplete headers for batch request
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   331
-------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   332
48620
c5f734ef0b15 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48619
diff changeset
   333
  $ hg serve \
c5f734ef0b15 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48619
diff changeset
   334
  > --config badserver.close-after-send-patterns='(.*Content-Type: applicat){2}' \
c5f734ef0b15 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48619
diff changeset
   335
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   336
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   337
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   338
TODO this output is horrible
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   339
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   340
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   341
  abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
35259
ad5f2b923b0d push: include a 'check:bookmarks' part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35232
diff changeset
   342
  ---%<--- (applicat)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   343
  
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   344
  ---%<---
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45839
diff changeset
   345
  
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   346
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   347
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   348
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   349
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   350
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   351
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   352
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   353
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   354
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   355
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   356
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   357
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   358
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   359
  write(160) -> (568) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   360
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   361
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   362
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   363
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   364
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   365
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   366
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   367
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   368
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   369
  readline(*) -> (2) \r\n (glob)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   370
  sendall(118 from 159) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: applicat (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   371
  write(118 from 159) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: applicat (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   372
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   373
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   374
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   375
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   376
  
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   377
  write(285) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   378
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   379
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   380
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   381
Server sends an incomplete HTTP response body to batch request
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   382
--------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   383
48621
b38a15822208 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48620
diff changeset
   384
  $ hg serve \
b38a15822208 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48620
diff changeset
   385
  > --config badserver.close-after-send-patterns=96ee1d7354c4ad7372047672 \
b38a15822208 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48620
diff changeset
   386
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   387
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   388
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   389
TODO client spews a stack due to uncaught ValueError in batch.results()
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 34322
diff changeset
   390
#if no-chg
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   391
  $ hg clone http://localhost:$HGPORT/ clone 2> /dev/null
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   392
  [1]
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 34322
diff changeset
   393
#else
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 34322
diff changeset
   394
  $ hg clone http://localhost:$HGPORT/ clone 2> /dev/null
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 34322
diff changeset
   395
  [255]
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 34322
diff changeset
   396
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   397
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   398
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   399
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   400
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   401
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   402
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   403
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   404
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   405
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   406
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   407
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   408
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   409
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   410
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   411
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   412
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   413
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   414
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   415
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   416
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   417
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   418
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   419
  readline(*) -> (2) \r\n (glob)
48621
b38a15822208 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48620
diff changeset
   420
  sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py36 !)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   421
  sendall(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py36 !)
48621
b38a15822208 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48620
diff changeset
   422
  write(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py3 no-py36 !)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   423
  write(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   424
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   425
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   426
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   427
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   428
  
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   429
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   430
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   431
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   432
Server sends incomplete headers for getbundle response
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   433
------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   434
48622
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   435
  $ hg serve \
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   436
  > --config badserver.close-after-send-patterns='(.*Content-Type: application/mercuri){3}' \
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   437
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   438
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   439
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   440
TODO this output is terrible
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   441
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   442
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   443
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   444
  abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
35268
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
   445
  ---%<--- (application/mercuri)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   446
  
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   447
  ---%<---
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45839
diff changeset
   448
  
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   449
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   450
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   451
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   452
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   453
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   454
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   455
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   456
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   457
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   458
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   459
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   460
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   461
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   462
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   463
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   464
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   465
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   466
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   467
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   468
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   469
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   470
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   471
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   472
  readline(*) -> (2) \r\n (glob)
48622
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   473
  sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py36 !)
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   474
  sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py36 !)
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   475
  write(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py3 no-py36 !)
7de3e7451763 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48621
diff changeset
   476
  write(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   477
  readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   478
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   479
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
   480
  readline(*) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   481
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   482
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   483
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   484
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   485
  readline(*) -> (2) \r\n (glob)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   486
  sendall(129 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercuri (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   487
  write(129 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercuri (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   488
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   489
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   490
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   491
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   492
  
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   493
  write(293) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   494
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   495
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   496
39484
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   497
Server stops before it sends transfer encoding
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   498
----------------------------------------------
39484
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   499
48624
8a452efcce3c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48623
diff changeset
   500
  $ hg serve \
8a452efcce3c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48623
diff changeset
   501
  > --config badserver.close-after-send-patterns="Transfer-Encoding: chunke" \
8a452efcce3c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48623
diff changeset
   502
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
39484
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   503
  $ cat hg.pid > $DAEMON_PIDS
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   504
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   505
  $ hg clone http://localhost:$HGPORT/ clone
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   506
  requesting all changes
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   507
  abort: stream ended unexpectedly (got 0 bytes, expected 1)
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   508
  [255]
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   509
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   510
  $ killdaemons.py $DAEMON_PIDS
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   511
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   512
#if py36
48623
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   513
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -6
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   514
  sendall(162 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunke
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   515
  write limit reached; closing socket
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   516
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   517
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   518
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   519
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   520
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   521
#else
48623
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   522
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -7
48624
8a452efcce3c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48623
diff changeset
   523
  write(41) -> Content-Type: application/mercurial-0.2\r\n
48623
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   524
  write(25 from 28) -> (0) Transfer-Encoding: chunke
38028f3ef80c test-http-bad-server: modify some `tail` call fit their goal
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48622
diff changeset
   525
  write limit reached; closing socket
48611
f91f98e9834a test-http-bad-server: unify log printing for `sendall` and `write`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48608
diff changeset
   526
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   527
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   528
  Exception: connection closed after sending N bytes
48611
f91f98e9834a test-http-bad-server: unify log printing for `sendall` and `write`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48608
diff changeset
   529
  write(293) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   530
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   531
#endif
39484
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   532
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   533
  $ rm -f error.log
98995b689e03 httppeer: use util.readexactly() to abort on incomplete responses
Anton Shestakov <av6@dwimlabs.net>
parents: 39483
diff changeset
   534
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   535
Server sends empty HTTP body for getbundle
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   536
------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   537
48625
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   538
  $ hg serve \
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   539
  > --config badserver.close-after-send-patterns='Transfer-Encoding: chunked\r\n\r\n' \
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   540
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   541
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   542
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   543
  $ hg clone http://localhost:$HGPORT/ clone
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   544
  requesting all changes
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   545
  abort: HTTP request error (incomplete response)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   546
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   547
  [255]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   548
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   549
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   550
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   551
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   552
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   553
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   554
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   555
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   556
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   557
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   558
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   559
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   560
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   561
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   562
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   563
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   564
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   565
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   566
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   567
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   568
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   569
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   570
  readline(*) -> (2) \r\n (glob)
48625
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   571
  sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py36 !)
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   572
  sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py36 !)
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   573
  write(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py3 no-py36 !)
fd7c578ddfd3 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48624
diff changeset
   574
  write(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   575
  readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   576
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   577
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
   578
  readline(*) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   579
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   580
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   581
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   582
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   583
  readline(*) -> (2) \r\n (glob)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   584
  sendall(167 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py36 !)
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   585
  write(167 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   586
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   587
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   588
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   589
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   590
  
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   591
  write(293) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\nHTTP/1.1 500 Internal Server Error\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   592
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   593
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   594
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   595
Server sends partial compression string
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   596
---------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   597
48626
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   598
  $ hg serve \
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   599
  > --config badserver.close-after-send-patterns='4\r\nHG20\r\n' \
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   600
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   601
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   602
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   603
  $ hg clone http://localhost:$HGPORT/ clone
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   604
  requesting all changes
35268
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
   605
  abort: HTTP request error (incomplete response)
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   606
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   607
  [255]
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   608
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   609
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   610
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   611
  $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   612
  readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   613
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   614
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   615
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   616
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   617
  readline(*) -> (2) \r\n (glob)
48643
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   618
  sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   619
  sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   620
  write(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob) (py3 no-py36 !)
1e28c4209fff test-http-bad-server: abstract the `streamreqs` value
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48642
diff changeset
   621
  write(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   622
  readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   623
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   624
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   625
  readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   626
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   627
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   628
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   629
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   630
  readline(*) -> (2) \r\n (glob)
48626
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   631
  sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py36 !)
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   632
  sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; (py36 !)
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   633
  write(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n (py3 no-py36 !)
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   634
  readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   635
  readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   636
  readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
   637
  readline(*) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
41465
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   638
  readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   639
  readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   640
  readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   641
  readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
33560f3bbcd3 tests: glob away readline(-1)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41462
diff changeset
   642
  readline(*) -> (2) \r\n (glob)
48626
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   643
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py36 !)
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   644
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc) (py36 !)
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   645
  sendall(9) -> 4\r\nnone\r\n (py36 !)
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   646
  sendall(9 from 9) -> (0) 4\r\nHG20\r\n (py36 !)
48626
62f1c8588fcc test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48625
diff changeset
   647
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 no-py36 !)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   648
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   649
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   650
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   651
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   652
  
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   653
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   654
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   655
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   656
Server sends partial bundle2 header magic
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   657
-----------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   658
48627
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   659
  $ hg serve \
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   660
  > --config badserver.close-after-send-patterns='4\r\nHG2' \
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   661
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   662
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   663
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   664
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   665
  requesting all changes
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   666
  abort: HTTP request error (incomplete response) (py3 !)
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   667
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   668
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   669
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   670
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   671
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   672
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   673
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -9
48627
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   674
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   675
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   676
  sendall(9) -> 4\r\nnone\r\n
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   677
  sendall(6 from 9) -> (0) 4\r\nHG2
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   678
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   679
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   680
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   681
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   682
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   683
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   684
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   685
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -11
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   686
  readline(~) -> (2) \r\n (py3 !)
48627
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   687
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   688
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
26105e9b0487 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48626
diff changeset
   689
  write(9) -> 4\r\nnone\r\n
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   690
  write(6 from 9) -> (0) 4\r\nHG2
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   691
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   692
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   693
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   694
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   695
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   696
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   697
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   698
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   699
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   700
Server sends incomplete bundle2 stream params length
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   701
----------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   702
48628
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   703
  $ hg serve \
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   704
  > --config badserver.close-after-send-patterns='4\r\n\0\0\0' \
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   705
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   706
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   707
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   708
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   709
  requesting all changes
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   710
  abort: HTTP request error (incomplete response) (py3 !)
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   711
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   712
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   713
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   714
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   715
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   716
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   717
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
48628
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   718
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   719
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   720
  sendall(9) -> 4\r\nnone\r\n
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   721
  sendall(9) -> 4\r\nHG20\r\n
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   722
  sendall(6 from 9) -> (0) 4\\r\\n\x00\x00\x00 (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   723
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   724
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   725
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   726
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   727
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   728
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   729
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   730
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   731
  readline(~) -> (2) \r\n (py3 !)
48628
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   732
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   733
  write(41) -> Content-Type: application/mercurial-0.2\r\n
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   734
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   735
  write(9) -> 4\r\nnone\r\n
ea2f4f4e464e test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48627
diff changeset
   736
  write(9) -> 4\r\nHG20\r\n
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   737
  write(6 from 9) -> (0) 4\\r\\n\x00\x00\x00 (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   738
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   739
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   740
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   741
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   742
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   743
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   744
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   745
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   746
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   747
Servers stops after bundle2 stream params header
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   748
------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   749
48629
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   750
  $ hg serve \
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   751
  > --config badserver.close-after-send-patterns='4\r\n\0\0\0\0\r\n' \
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   752
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   753
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   754
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   755
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   756
  requesting all changes
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   757
  abort: HTTP request error (incomplete response)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   758
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   759
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   760
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   761
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   762
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   763
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   764
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
48629
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   765
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   766
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   767
  sendall(9) -> 4\r\nnone\r\n
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   768
  sendall(9) -> 4\r\nHG20\r\n
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   769
  sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   770
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   771
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   772
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   773
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   774
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   775
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   776
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   777
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   778
  readline(~) -> (2) \r\n (py3 !)
48629
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   779
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   780
  write(41) -> Content-Type: application/mercurial-0.2\r\n
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   781
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   782
  write(9) -> 4\r\nnone\r\n
177ef11a4a58 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48628
diff changeset
   783
  write(9) -> 4\r\nHG20\r\n
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   784
  write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   785
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   786
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   787
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   788
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   789
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   790
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   791
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   792
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   793
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   794
Server stops sending after bundle2 part header length
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   795
-----------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   796
48630
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   797
  $ hg serve \
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   798
  > --config badserver.close-after-send-patterns='4\r\n\0\0\0\)\r\n' \
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   799
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   800
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   801
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   802
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   803
  requesting all changes
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   804
  abort: HTTP request error (incomplete response)
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
   805
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   806
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   807
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   808
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   809
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   810
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   811
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -11
48630
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   812
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   813
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   814
  sendall(9) -> 4\r\nnone\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   815
  sendall(9) -> 4\r\nHG20\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   816
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   817
  sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   818
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   819
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   820
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   821
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   822
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   823
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   824
#else
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   825
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   826
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -13
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   827
  readline(~) -> (2) \r\n (py3 !)
48630
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   828
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   829
  write(41) -> Content-Type: application/mercurial-0.2\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   830
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   831
  write(9) -> 4\r\nnone\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   832
  write(9) -> 4\r\nHG20\r\n
3e0462ae6230 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48629
diff changeset
   833
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   834
  write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   835
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   836
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   837
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   838
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   839
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   840
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   841
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   842
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   843
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   844
Server stops sending after bundle2 part header
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   845
----------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   846
48631
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   847
  $ hg serve \
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   848
  > --config badserver.close-after-send-patterns="version02nbchanges1\\r\\n" \
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   849
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   850
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   851
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   852
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   853
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   854
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   855
  transaction abort!
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   856
  rollback completed
32024
ad41739c6b2b bundle2: ignore errors seeking a bundle after an exception (issue4784)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32022
diff changeset
   857
  abort: HTTP request error (incomplete response)
ad41739c6b2b bundle2: ignore errors seeking a bundle after an exception (issue4784)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32022
diff changeset
   858
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   859
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   860
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   861
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   862
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   863
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   864
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12
48631
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   865
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   866
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   867
  sendall(9) -> 4\r\nnone\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   868
  sendall(9) -> 4\r\nHG20\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   869
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   870
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   871
  sendall(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   872
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   873
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   874
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   875
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   876
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   877
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   878
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   879
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   880
  readline(~) -> (2) \r\n (py3 !)
48631
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   881
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   882
  write(41) -> Content-Type: application/mercurial-0.2\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   883
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   884
  write(9) -> 4\r\nnone\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   885
  write(9) -> 4\r\nHG20\r\n
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   886
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
42057c14bf69 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48630
diff changeset
   887
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   888
  write(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   889
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   890
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   891
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   892
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   893
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   894
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   895
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   896
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   897
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   898
Server stops after bundle2 part payload chunk size
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   899
--------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   900
48632
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   901
  $ hg serve \
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   902
  > --config badserver.close-after-send-patterns='1d2\r\n.......' \
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   903
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   904
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   905
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   906
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   907
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   908
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   909
  transaction abort!
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   910
  rollback completed
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   911
  abort: HTTP request error (incomplete response) (py3 !)
32024
ad41739c6b2b bundle2: ignore errors seeking a bundle after an exception (issue4784)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32022
diff changeset
   912
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   913
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   914
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   915
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   916
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   917
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   918
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
48632
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   919
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   920
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   921
  sendall(9) -> 4\r\nnone\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   922
  sendall(9) -> 4\r\nHG20\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   923
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   924
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   925
  sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   926
  sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   927
  sendall(12 from 473) -> (0) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1d (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   928
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   929
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   930
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   931
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   932
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   933
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   934
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   935
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -15
48632
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   936
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   937
  write(28) -> Transfer-Encoding: chunked\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   938
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   939
  write(9) -> 4\r\nnone\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   940
  write(9) -> 4\r\nHG20\r\n
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   941
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   942
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   943
  write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
387f47807ca7 test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48631
diff changeset
   944
  write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
35268
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
   945
  write(12 from 473) -> (0) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1d (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   946
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   947
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   948
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   949
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   950
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   951
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   952
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   953
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   954
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   955
Server stops sending in middle of bundle2 payload chunk
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
   956
-------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   957
48633
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   958
  $ hg serve \
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   959
  > --config badserver.close-after-send-patterns=':jL\0\0\x00\0\0\0\0\0\r\n' \
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   960
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   961
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   962
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   963
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   964
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   965
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   966
  transaction abort!
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   967
  rollback completed
32024
ad41739c6b2b bundle2: ignore errors seeking a bundle after an exception (issue4784)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32022
diff changeset
   968
  abort: HTTP request error (incomplete response)
ad41739c6b2b bundle2: ignore errors seeking a bundle after an exception (issue4784)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32022
diff changeset
   969
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   970
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   971
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   972
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   973
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
   974
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   975
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
48633
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   976
  sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   977
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   978
  sendall(9) -> 4\r\nnone\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   979
  sendall(9) -> 4\r\nHG20\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   980
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   981
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   982
  sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   983
  sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   984
  sendall(473 from 473) -> (0) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   985
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   986
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   987
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   988
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   989
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   990
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
   991
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
   992
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -16
48615
e38776a4c2cb test-http-bad-server: replace the default 65537 value in output
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48611
diff changeset
   993
  readline(~) -> (2) \r\n (py3 !)
48633
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   994
  write(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n (py3 !)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   995
  write(41) -> Content-Type: application/mercurial-0.2\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   996
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   997
  write(9) -> 4\r\nnone\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   998
  write(9) -> 4\r\nHG20\r\n
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
   999
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
  1000
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
  1001
  write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
52aa9b505c8f test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48632
diff changeset
  1002
  write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1003
  write(473 from 473) -> (0) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1004
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1005
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1006
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1007
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1008
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1009
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1010
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1011
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1012
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1013
Server stops sending after 0 length payload chunk size
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
  1014
------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1015
48634
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1016
  $ hg serve \
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1017
  > --config badserver.close-after-send-patterns=LISTKEYS \
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1018
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1019
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1020
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1021
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1022
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1023
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1024
  adding manifests
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1025
  adding file changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1026
  transaction abort!
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1027
  rollback completed
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1028
  abort: HTTP request error (incomplete response) (py3 !)
32002
bf855efe5664 httppeer: wrap HTTPResponse.read() globally
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32001
diff changeset
  1029
  (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1030
  [255]
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1031
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1032
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1033
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
  1034
#if py36
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1035
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -16
48634
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1036
  sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1037
  sendall(9) -> 4\r\nnone\r\n
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1038
  sendall(9) -> 4\r\nHG20\r\n
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1039
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1040
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1041
  sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1042
  sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1043
  sendall(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1044
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1045
  sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1046
  sendall(13 from 38) -> (0) 20\\r\\n\x08LISTKEYS (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1047
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1048
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1049
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1050
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1051
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1052
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1053
#else
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1054
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -17
48634
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1055
  write(2) -> \r\n
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1056
  write(6) -> 1\\r\\n\x04\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1057
  write(9) -> 4\r\nnone\r\n
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1058
  write(9) -> 4\r\nHG20\r\n
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1059
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1060
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1061
  write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1062
  write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1063
  write(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1064
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4e772a5dfa5b test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48633
diff changeset
  1065
  write(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
35268
44b8b5ad30eb pull: retrieve bookmarks through the binary part when possible
Boris Feld <boris.feld@octobus.net>
parents: 35259
diff changeset
  1066
  write(13 from 38) -> (0) 20\\r\\n\x08LISTKEYS (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1067
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1068
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1069
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1070
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1071
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1072
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1073
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1074
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1075
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1076
Server stops sending after 0 part bundle part header (indicating end of bundle2 payload)
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
  1077
----------------------------------------------------------------------------------------
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
  1078
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1079
This is before the 0 size chunked transfer part that signals end of HTTP response.
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1080
48635
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1081
  $ hg serve \
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1082
  > --config badserver.close-after-send-patterns='(.*4\r\n\0\0\0\0\r\n){5}' \
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1083
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1084
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1085
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1086
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1087
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1088
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1089
  adding manifests
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1090
  adding file changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1091
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34483
diff changeset
  1092
  new changesets 96ee1d7354c4
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1093
  updating to branch default
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1094
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1095
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1096
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1097
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
  1098
#if py36
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
  1099
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -20
48635
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1100
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1101
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1102
  sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1103
  sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1104
  sendall(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1105
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1106
  sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1107
  sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00	\x06namespacephases\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1108
  sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1109
  sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c	1\npublishing	True\r\n
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1110
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1111
  sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1112
  sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00		namespacebookmarks\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1113
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1114
  sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1115
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1116
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1117
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1118
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1119
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1120
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1121
#else
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
  1122
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21
48635
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1123
  write(9) -> 4\r\nHG20\r\n
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1124
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1125
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1126
  write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1127
  write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1128
  write(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1129
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1130
  write(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1131
  write(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00	\x06namespacephases\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1132
  write(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1133
  write(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c	1\npublishing	True\r\n
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1134
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1135
  write(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1136
  write(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00		namespacebookmarks\\r\\n (esc)
6a9f3cd38faa test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48634
diff changeset
  1137
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1138
  write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1139
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1140
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1141
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1142
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1143
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1144
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1145
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1146
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1147
  $ rm -rf clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1148
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1149
Server sends a size 0 chunked-transfer size without terminating \r\n
48607
89485747b8f7 test-http-bad-server: highlight each test with section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48606
diff changeset
  1150
--------------------------------------------------------------------
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1151
48636
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1152
  $ hg serve \
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1153
  > --config badserver.close-after-send-patterns="(.*4\\r\\n\0\0\0\0\\r\\n0\r\n)" \
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1154
  > -p $HGPORT -d --pid-file=hg.pid -E error.log
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1155
  $ cat hg.pid > $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1156
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1157
  $ hg clone http://localhost:$HGPORT/ clone
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1158
  requesting all changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1159
  adding changesets
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1160
  adding manifests
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1161
  adding file changes
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1162
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34483
diff changeset
  1163
  new changesets 96ee1d7354c4
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1164
  updating to branch default
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1165
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1166
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1167
  $ killdaemons.py $DAEMON_PIDS
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1168
41467
1016b81fa43e tests: conditionalize test-http-bad-server.t for Python 3.5
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41466
diff changeset
  1169
#if py36
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
  1170
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21
48636
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1171
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1172
  sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1173
  sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1174
  sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1175
  sendall(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1176
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1177
  sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1178
  sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00	\x06namespacephases\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1179
  sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1180
  sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c	1\npublishing	True\r\n
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1181
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1182
  sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1183
  sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00		namespacebookmarks\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1184
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1185
  sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1186
  sendall(3 from 5) -> (0) 0\r\n
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1187
  write limit reached; closing socket
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1188
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1189
  Traceback (most recent call last):
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1190
  Exception: connection closed after sending N bytes
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1191
  
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1192
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1193
#else
46633
7015b0232c5e exchange: stop advertising rev-branch-cache bundle capability
Joerg Sonnenberger <joerg@bec.de>
parents: 45906
diff changeset
  1194
  $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -22
48636
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1195
  write(9) -> 4\r\nHG20\r\n
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1196
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1197
  write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1198
  write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02	\x01version02nbchanges1\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1199
  write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1200
  write(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1201
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1202
  write(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1203
  write(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00	\x06namespacephases\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1204
  write(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1205
  write(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c	1\npublishing	True\r\n
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1206
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1207
  write(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1208
  write(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00		namespacebookmarks\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1209
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
b169767ecc8c test-http-bad-server: move on test from bytes-count to pattern
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48635
diff changeset
  1210
  write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1211
  write(3 from 5) -> (0) 0\r\n
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1212
  write limit reached; closing socket
41462
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1213
  $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1214
  Traceback (most recent call last):
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1215
  Exception: connection closed after sending N bytes
9b2b8794f801 hgweb: log error before attempting I/O
Gregory Szorc <gregory.szorc@gmail.com>
parents: 40982
diff changeset
  1216
  
41466
4d5aae86c9bd tests: log sendall() operations and port test-http-bad-server.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41465
diff changeset
  1217
#endif
32001
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1218
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1219
  $ rm -f error.log
c85f19c66e8d tests: add tests for poorly behaving HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1220
  $ rm -rf clone