comparison tests/test-http-bad-server.t @ 48639:ebd515d129c6

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. Differential Revision: https://phab.mercurial-scm.org/D12070
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 21 Jan 2022 19:04:10 +0100
parents 1ae83cafaa39
children 316b912c47f5
comparison
equal deleted inserted replaced
48638:1ae83cafaa39 48639:ebd515d129c6
110 $ rm -f error.log 110 $ rm -f error.log
111 111
112 Failure on subsequent HTTP request on the same socket (cmd?batch) 112 Failure on subsequent HTTP request on the same socket (cmd?batch)
113 ----------------------------------------------------------------- 113 -----------------------------------------------------------------
114 114
115 $ hg serve --config badserver.close-after-recv-bytes=210,223 -p $HGPORT -d --pid-file=hg.pid -E error.log 115 $ hg serve \
116 > --config badserver.close-after-recv-patterns="GET /\?cmd=batch," \
117 > --config badserver.close-after-recv-bytes=15,223 \
118 > -p $HGPORT -d --pid-file=hg.pid -E error.log
116 $ cat hg.pid > $DAEMON_PIDS 119 $ cat hg.pid > $DAEMON_PIDS
117 $ hg clone http://localhost:$HGPORT/ clone 120 $ hg clone http://localhost:$HGPORT/ clone
118 abort: error: bad HTTP status line: * (glob) 121 abort: error: bad HTTP status line: * (glob)
119 [100] 122 [100]
120 123
121 $ killdaemons.py $DAEMON_PIDS 124 $ killdaemons.py $DAEMON_PIDS
122 125
123 $ cat error.log 126 $ cat error.log
124 readline(210 from ~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n 127 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
125 readline(177 from *) -> (27) Accept-Encoding: identity\r\n (glob) 128 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
126 readline(150 from *) -> (35) accept: application/mercurial-0.1\r\n (glob) 129 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
127 readline(115 from *) -> (*) host: localhost:$HGPORT\r\n (glob) 130 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
128 readline(* from *) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob) 131 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
129 readline(* from *) -> (2) \r\n (glob) 132 readline(*) -> (2) \r\n (glob)
130 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 !) 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: 431\r\n\r\n (py36 !)
131 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 !) 134 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 !)
132 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 !) 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: 431\r\n\r\n (py3 no-py36 !)
133 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 !) 136 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 !)
134 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !) 137 write(36) -> HTTP/1.1 200 Script output follows\r\n (no-py3 !)
136 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !) 139 write(37) -> Date: $HTTP_DATE$\r\n (no-py3 !)
137 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !) 140 write(41) -> Content-Type: application/mercurial-0.1\r\n (no-py3 !)
138 write(21) -> Content-Length: 431\r\n (no-py3 !) 141 write(21) -> Content-Length: 431\r\n (no-py3 !)
139 write(2) -> \r\n (no-py3 !) 142 write(2) -> \r\n (no-py3 !)
140 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 !) 143 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 !)
141 readline(4? from ~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob) 144 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
142 readline(1? from *) -> (1?) Accept-Encoding* (glob) 145 readline(*) -> (1?) Accept-Encoding* (glob)
143 read limit reached; closing socket 146 read limit reached; closing socket
144 readline(223 from ~) -> (26) GET /?cmd=batch HTTP/1.1\r\n 147 readline(223 from ~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
145 readline(197 from *) -> (27) Accept-Encoding: identity\r\n (glob) 148 readline(197 from *) -> (27) Accept-Encoding: identity\r\n (glob)
146 readline(170 from *) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob) 149 readline(170 from *) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
147 readline(141 from *) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob) 150 readline(141 from *) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)