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.
Alphare |
hg-reviewers |
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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-http-bad-server.t (34 lines) |
#endif | #endif | ||||
$ rm -f error.log | $ rm -f error.log | ||||
Server stops sending after bundle2 part header | Server stops sending after bundle2 part header | ||||
---------------------------------------------- | ---------------------------------------------- | ||||
$ hg serve --config badserver.close-after-send-bytes=1048 -p $HGPORT -d --pid-file=hg.pid -E error.log | $ hg serve \ | ||||
> --config badserver.close-after-send-patterns="version02nbchanges1\\r\\n" \ | |||||
> -p $HGPORT -d --pid-file=hg.pid -E error.log | |||||
$ cat hg.pid > $DAEMON_PIDS | $ cat hg.pid > $DAEMON_PIDS | ||||
$ hg clone http://localhost:$HGPORT/ clone | $ hg clone http://localhost:$HGPORT/ clone | ||||
requesting all changes | requesting all changes | ||||
adding changesets | adding changesets | ||||
transaction abort! | transaction abort! | ||||
rollback completed | rollback completed | ||||
abort: HTTP request error (incomplete response) | abort: HTTP request error (incomplete response) | ||||
(this may be an intermittent network failure; if the error persists, consider contacting the network or server operator) | (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator) | ||||
[255] | [255] | ||||
$ killdaemons.py $DAEMON_PIDS | $ killdaemons.py $DAEMON_PIDS | ||||
#if py36 | #if py36 | ||||
$ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12 | $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12 | ||||
sendall(167 from 167) -> (89) 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 | 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 | ||||
sendall(6 from 6) -> (83) 1\\r\\n\x04\\r\\n (esc) | sendall(6) -> 1\\r\\n\x04\\r\\n (esc) | ||||
sendall(9 from 9) -> (74) 4\r\nnone\r\n | sendall(9) -> 4\r\nnone\r\n | ||||
sendall(9 from 9) -> (65) 4\r\nHG20\r\n | sendall(9) -> 4\r\nHG20\r\n | ||||
sendall(9 from 9) -> (56) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | ||||
sendall(9 from 9) -> (47) 4\\r\\n\x00\x00\x00)\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc) | ||||
sendall(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | sendall(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | ||||
write limit reached; closing socket | write limit reached; closing socket | ||||
$LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob) | $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob) | ||||
Traceback (most recent call last): | Traceback (most recent call last): | ||||
Exception: connection closed after sending N bytes | Exception: connection closed after sending N bytes | ||||
#else | #else | ||||
$ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14 | $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14 | ||||
readline(~) -> (2) \r\n (py3 !) | readline(~) -> (2) \r\n (py3 !) | ||||
write(167 from 167) -> (89) 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 !) | 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 !) | ||||
write(41 from 41) -> (119) Content-Type: application/mercurial-0.2\r\n | write(41) -> Content-Type: application/mercurial-0.2\r\n | ||||
write(28 from 28) -> (91) Transfer-Encoding: chunked\r\n | write(28) -> Transfer-Encoding: chunked\r\n (no-py3 !) | ||||
write(2 from 2) -> (89) \r\n | write(2) -> \r\n (no-py3 !) | ||||
write(6 from 6) -> (83) 1\\r\\n\x04\\r\\n (esc) | write(6) -> 1\\r\\n\x04\\r\\n (esc) | ||||
write(9 from 9) -> (74) 4\r\nnone\r\n | write(9) -> 4\r\nnone\r\n | ||||
write(9 from 9) -> (65) 4\r\nHG20\r\n | write(9) -> 4\r\nHG20\r\n | ||||
write(9 from 9) -> (56) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | ||||
write(9 from 9) -> (47) 4\\r\\n\x00\x00\x00)\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc) | ||||
write(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | write(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | ||||
write limit reached; closing socket | write limit reached; closing socket | ||||
$LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob) | $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob) | ||||
Traceback (most recent call last): | Traceback (most recent call last): | ||||
Exception: connection closed after sending N bytes | Exception: connection closed after sending N bytes | ||||
#endif | #endif | ||||