comparison tests/test-http-bad-server.t @ 48621:b38a15822208

test-http-bad-server: move on test from bytes-count to pattern This specific test case is now using the new "close when a pattern is seen" approach compared to the more fragile "that many bytes were sent" approach. Since such change are still a bit noisy, we split each change in there own changesets. Differential Revision: https://phab.mercurial-scm.org/D12052
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 21 Jan 2022 16:02:26 +0100
parents c5f734ef0b15
children 7de3e7451763
comparison
equal deleted inserted replaced
48620:c5f734ef0b15 48621:b38a15822208
413 $ rm -f error.log 413 $ rm -f error.log
414 414
415 Server sends an incomplete HTTP response body to batch request 415 Server sends an incomplete HTTP response body to batch request
416 -------------------------------------------------------------- 416 --------------------------------------------------------------
417 417
418 $ hg serve --config badserver.close-after-send-bytes=774 -p $HGPORT -d --pid-file=hg.pid -E error.log 418 $ hg serve \
419 > --config badserver.close-after-send-patterns=96ee1d7354c4ad7372047672 \
420 > -p $HGPORT -d --pid-file=hg.pid -E error.log
419 $ cat hg.pid > $DAEMON_PIDS 421 $ cat hg.pid > $DAEMON_PIDS
420 422
421 TODO client spews a stack due to uncaught ValueError in batch.results() 423 TODO client spews a stack due to uncaught ValueError in batch.results()
422 #if no-chg 424 #if no-chg
423 $ hg clone http://localhost:$HGPORT/ clone 2> /dev/null 425 $ hg clone http://localhost:$HGPORT/ clone 2> /dev/null
434 readline(*) -> (27) Accept-Encoding: identity\r\n (glob) 436 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
435 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob) 437 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
436 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob) 438 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
437 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob) 439 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
438 readline(*) -> (2) \r\n (glob) 440 readline(*) -> (2) \r\n (glob)
439 sendall(160 from 160) -> (614) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 431\r\n\r\n (py36 !) 441 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: 431\r\n\r\n (py36 !)
440 sendall(431 from 431) -> (183) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py36 !) 442 sendall(431) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py36 !)
441 write(160 from 160) -> (633) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 431\r\n\r\n (py3 no-py36 !) 443 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: 431\r\n\r\n (py3 no-py36 !)
442 write(431 from 431) -> (183) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py3 no-py36 !) 444 write(431) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (py3 no-py36 !)
443 write(36 from 36) -> (738) HTTP/1.1 200 Script output follows\r\n (no-py3 !) 445 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !)
444 write(23 from 23) -> (715) Server: badhttpserver\r\n (no-py3 !) 446 write(23) -> Server: badhttpserver\r\n (no-py3 !)
445 write(37 from 37) -> (678) Date: $HTTP_DATE$\r\n (no-py3 !) 447 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !)
446 write(41 from 41) -> (637) Content-Type: application/mercurial-0.1\r\n (no-py3 !) 448 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !)
447 write(21 from 21) -> (616) Content-Length: 431\r\n (no-py3 !) 449 write(21) -> Content-Length: 431\r\n (no-py3 !)
448 write(2 from 2) -> (614) \r\n (no-py3 !) 450 write(2) -> \r\n (no-py3 !)
449 write(431 from 431) -> (183) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-py3 !) 451 write(431) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-py3 !)
450 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n 452 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
451 readline(*) -> (27) Accept-Encoding: identity\r\n (glob) 453 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
452 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob) 454 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
453 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob) 455 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
454 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob) 456 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
455 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob) 457 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
456 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob) 458 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
457 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob) 459 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
458 readline(*) -> (2) \r\n (glob) 460 readline(*) -> (2) \r\n (glob)
459 sendall(159 from 159) -> (24) 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 !) 461 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 !)
460 sendall(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py36 !) 462 sendall(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py36 !)
461 write(159 from 159) -> (24) 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 !) 463 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 !)
462 write(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py3 no-py36 !) 464 write(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (py3 no-py36 !)
463 write(36 from 36) -> (147) HTTP/1.1 200 Script output follows\r\n (no-py3 !) 465 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !)
464 write(23 from 23) -> (124) Server: badhttpserver\r\n (no-py3 !) 466 write(23) -> Server: badhttpserver\r\n (no-py3 !)
465 write(37 from 37) -> (87) Date: $HTTP_DATE$\r\n (no-py3 !) 467 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !)
466 write(41 from 41) -> (46) Content-Type: application/mercurial-0.1\r\n (no-py3 !) 468 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !)
467 write(20 from 20) -> (26) Content-Length: 42\r\n (no-py3 !) 469 write(20) -> Content-Length: 42\r\n (no-py3 !)
468 write(2 from 2) -> (24) \r\n (no-py3 !) 470 write(2) -> \r\n (no-py3 !)
469 write(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (no-py3 !) 471 write(24 from 42) -> (0) 96ee1d7354c4ad7372047672 (no-py3 !)
470 write limit reached; closing socket 472 write limit reached; closing socket
471 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob) 473 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
472 Traceback (most recent call last): 474 Traceback (most recent call last):
473 Exception: connection closed after sending N bytes 475 Exception: connection closed after sending N bytes