comparison tests/test-http-bad-server.t @ 48664:009e86022a9d

test-http-bad-server: use the new pattern-reading for a test-case This test case is now less sensitive to change of unrelated bits of the client/server exchange. Since this introduce some churn in the output, we do it independently for each test cases. This patch is the last of such changes, for both sent and recv cases. Differential Revision: https://phab.mercurial-scm.org/D12073
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 21 Jan 2022 19:57:47 +0100
parents 36a41521ed57
children 1e28c4209fff
comparison
equal deleted inserted replaced
48663:36a41521ed57 48664:009e86022a9d
227 $ rm -f error.log 227 $ rm -f error.log
228 228
229 Now do a variation using POST to send arguments 229 Now do a variation using POST to send arguments
230 =============================================== 230 ===============================================
231 231
232 $ hg serve --config experimental.httppostargs=true --config badserver.close-after-recv-bytes=329,344 -p $HGPORT -d --pid-file=hg.pid -E error.log 232 $ hg serve \
233 > --config badserver.close-after-recv-patterns="x-hgargs-post:,user-agent: mercurial/proto-1.0" \
234 > --config badserver.close-after-recv-bytes="14,26" \
235 > --config experimental.httppostargs=true \
236 > -p $HGPORT -d --pid-file=hg.pid -E error.log
233 $ cat hg.pid > $DAEMON_PIDS 237 $ cat hg.pid > $DAEMON_PIDS
234 238
235 $ hg clone http://localhost:$HGPORT/ clone 239 $ hg clone http://localhost:$HGPORT/ clone
236 abort: error: bad HTTP status line: * (glob) 240 abort: error: bad HTTP status line: * (glob)
237 [100] 241 [100]
238 242
239 $ killdaemons.py $DAEMON_PIDS 243 $ killdaemons.py $DAEMON_PIDS
240 244
241 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py 245 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
242 readline(329 from ~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n 246 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
243 readline(296 from *) -> (27) Accept-Encoding: identity\r\n (glob) 247 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
244 readline(269 from *) -> (35) accept: application/mercurial-0.1\r\n (glob) 248 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
245 readline(234 from *) -> (2?) host: localhost:$HGPORT\r\n (glob) 249 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
246 readline(* from *) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob) 250 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
247 readline(* from *) -> (2) \r\n (glob) 251 readline(*) -> (2) \r\n (glob)
248 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: 444\r\n\r\n (py36 !) 252 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: 444\r\n\r\n (py36 !)
249 sendall(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py36 !) 253 sendall(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py36 !)
250 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: 444\r\n\r\n (py3 no-py36 !) 254 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: 444\r\n\r\n (py3 no-py36 !)
251 write(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py3 no-py36 !) 255 write(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py3 no-py36 !)
252 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !) 256 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !)
254 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !) 258 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !)
255 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !) 259 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !)
256 write(21) -> Content-Length: 444\r\n (no-py3 !) 260 write(21) -> Content-Length: 444\r\n (no-py3 !)
257 write(2) -> \r\n (no-py3 !) 261 write(2) -> \r\n (no-py3 !)
258 write(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-py3 !) 262 write(444) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-py3 !)
259 readline(1?? from ~) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob) 263 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob)
260 readline(1?? from *) -> (27) Accept-Encoding: identity\r\n (glob) 264 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
261 readline(1?? from *) -> (41) content-type: application/mercurial-0.1\r\n (glob) 265 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
262 readline(6? from *) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob) 266 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
263 readline(3? from *) -> (19) x-hgargs-post: 28\r\n (glob) 267 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
264 readline(1? from *) -> (1?) x-hgproto-1: * (glob) 268 readline(*) -> (1?) x-hgproto-1: * (glob)
265 read limit reached; closing socket 269 read limit reached; closing socket
266 readline(344 from ~) -> (27) POST /?cmd=batch HTTP/1.1\r\n 270 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n
267 readline(317 from *) -> (27) Accept-Encoding: identity\r\n (glob) 271 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
268 readline(290 from *) -> (41) content-type: application/mercurial-0.1\r\n (glob) 272 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
269 readline(249 from *) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob) 273 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
270 readline(216 from *) -> (19) x-hgargs-post: 28\r\n (glob) 274 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
271 readline(197 from *) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob) 275 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
272 readline(136 from *) -> (35) accept: application/mercurial-0.1\r\n (glob) 276 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
273 readline(101 from *) -> (20) content-length: 28\r\n (glob) 277 readline(*) -> (20) content-length: 28\r\n (glob)
274 readline(81 from *) -> (*) host: localhost:$HGPORT\r\n (glob) 278 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
275 readline(* from *) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob) 279 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
276 readline(* from *) -> (2) \r\n (glob) 280 readline(*) -> (2) \r\n (glob)
277 read(* from 28) -> (*) cmds=* (glob) 281 read(24 from 28) -> (*) cmds=* (glob)
278 read limit reached; closing socket 282 read limit reached; closing socket
279 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob) 283 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
280 Traceback (most recent call last): 284 Traceback (most recent call last):
281 Exception: connection closed after receiving N bytes 285 Exception: connection closed after receiving N bytes
282 286