Mercurial > hg
comparison tests/test-http-bad-server.t @ 34308:9bd003052d55
keepalive: add more context to bad status line errors
As the TODO in the test said, the previous error message was not
very helpful. Let's improve things.
Differential Revision: https://phab.mercurial-scm.org/D811
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 25 Sep 2017 11:05:16 +0200 |
parents | d3177aecac01 |
children | 10e162bb9bf5 |
comparison
equal
deleted
inserted
replaced
34307:afcbc6f64d27 | 34308:9bd003052d55 |
---|---|
66 Failure to read all bytes in initial HTTP request should yield connection related error message | 66 Failure to read all bytes in initial HTTP request should yield connection related error message |
67 | 67 |
68 $ hg --config badserver.closeafterrecvbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 68 $ hg --config badserver.closeafterrecvbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
69 $ cat hg.pid > $DAEMON_PIDS | 69 $ cat hg.pid > $DAEMON_PIDS |
70 | 70 |
71 TODO this error message is not very good | 71 $ hg clone http://localhost:$HGPORT/ clone |
72 | 72 abort: error: bad HTTP status line: '' |
73 $ hg clone http://localhost:$HGPORT/ clone | |
74 abort: error: '' | |
75 [255] | 73 [255] |
76 | 74 |
77 $ killdaemons.py $DAEMON_PIDS | 75 $ killdaemons.py $DAEMON_PIDS |
78 | 76 |
79 $ cat error.log | 77 $ cat error.log |
85 Same failure, but server reads full HTTP request line | 83 Same failure, but server reads full HTTP request line |
86 | 84 |
87 $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 85 $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
88 $ cat hg.pid > $DAEMON_PIDS | 86 $ cat hg.pid > $DAEMON_PIDS |
89 $ hg clone http://localhost:$HGPORT/ clone | 87 $ hg clone http://localhost:$HGPORT/ clone |
90 abort: error: '' | 88 abort: error: bad HTTP status line: '' |
91 [255] | 89 [255] |
92 | 90 |
93 $ killdaemons.py $DAEMON_PIDS | 91 $ killdaemons.py $DAEMON_PIDS |
94 | 92 |
95 $ cat error.log | 93 $ cat error.log |
102 Failure on subsequent HTTP request on the same socket (cmd?batch) | 100 Failure on subsequent HTTP request on the same socket (cmd?batch) |
103 | 101 |
104 $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 102 $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
105 $ cat hg.pid > $DAEMON_PIDS | 103 $ cat hg.pid > $DAEMON_PIDS |
106 $ hg clone http://localhost:$HGPORT/ clone | 104 $ hg clone http://localhost:$HGPORT/ clone |
107 abort: error: '' | 105 abort: error: bad HTTP status line: '' |
108 [255] | 106 [255] |
109 | 107 |
110 $ killdaemons.py $DAEMON_PIDS | 108 $ killdaemons.py $DAEMON_PIDS |
111 | 109 |
112 $ cat error.log | 110 $ cat error.log |
141 | 139 |
142 $ hg --config badserver.closeafterrecvbytes=292 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 140 $ hg --config badserver.closeafterrecvbytes=292 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
143 $ cat hg.pid > $DAEMON_PIDS | 141 $ cat hg.pid > $DAEMON_PIDS |
144 $ hg clone http://localhost:$HGPORT/ clone | 142 $ hg clone http://localhost:$HGPORT/ clone |
145 requesting all changes | 143 requesting all changes |
146 abort: error: '' | 144 abort: error: bad HTTP status line: '' |
147 [255] | 145 [255] |
148 | 146 |
149 $ killdaemons.py $DAEMON_PIDS | 147 $ killdaemons.py $DAEMON_PIDS |
150 | 148 |
151 $ cat error.log | 149 $ cat error.log |
198 | 196 |
199 $ hg --config experimental.httppostargs=true --config badserver.closeafterrecvbytes=315 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 197 $ hg --config experimental.httppostargs=true --config badserver.closeafterrecvbytes=315 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
200 $ cat hg.pid > $DAEMON_PIDS | 198 $ cat hg.pid > $DAEMON_PIDS |
201 | 199 |
202 $ hg clone http://localhost:$HGPORT/ clone | 200 $ hg clone http://localhost:$HGPORT/ clone |
203 abort: error: '' | 201 abort: error: bad HTTP status line: '' |
204 [255] | 202 [255] |
205 | 203 |
206 $ killdaemons.py $DAEMON_PIDS | 204 $ killdaemons.py $DAEMON_PIDS |
207 | 205 |
208 $ cat error.log | 206 $ cat error.log |
249 | 247 |
250 $ hg --config badserver.closeaftersendbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | 248 $ hg --config badserver.closeaftersendbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
251 $ cat hg.pid > $DAEMON_PIDS | 249 $ cat hg.pid > $DAEMON_PIDS |
252 | 250 |
253 $ hg clone http://localhost:$HGPORT/ clone | 251 $ hg clone http://localhost:$HGPORT/ clone |
254 abort: error: H | 252 abort: error: bad HTTP status line: H |
255 [255] | 253 [255] |
256 | 254 |
257 $ killdaemons.py $DAEMON_PIDS | 255 $ killdaemons.py $DAEMON_PIDS |
258 | 256 |
259 $ cat error.log | 257 $ cat error.log |