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 (66 lines) | 
| #endif | #endif | ||||
| $ rm -f error.log | $ rm -f error.log | ||||
| $ rm -rf clone | $ rm -rf clone | ||||
| Server sends a size 0 chunked-transfer size without terminating \r\n | Server sends a size 0 chunked-transfer size without terminating \r\n | ||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | ||||
| $ hg serve --config badserver.close-after-send-bytes=1739 -p $HGPORT -d --pid-file=hg.pid -E error.log | $ hg serve \ | ||||
| > --config badserver.close-after-send-patterns="(.*4\\r\\n\0\0\0\0\\r\\n0\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 | ||||
| adding manifests | adding manifests | ||||
| adding file changes | adding file changes | ||||
| added 1 changesets with 1 changes to 1 files | added 1 changesets with 1 changes to 1 files | ||||
| new changesets 96ee1d7354c4 | new changesets 96ee1d7354c4 | ||||
| updating to branch default | updating to branch default | ||||
| 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
| $ killdaemons.py $DAEMON_PIDS | $ killdaemons.py $DAEMON_PIDS | ||||
| #if py36 | #if py36 | ||||
| $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21 | $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21 | ||||
| sendall(9 from 9) -> (747) 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) -> (738) 4\\r\\n\x00\x00\x00)\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc) | ||||
| sendall(47 from 47) -> (691) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | ||||
| sendall(9 from 9) -> (682) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc) | ||||
| sendall(473 from 473) -> (209) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc) | sendall(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc) | ||||
| sendall(9 from 9) -> (200) 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) -> (191) 4\\r\\n\x00\x00\x00 \\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc) | ||||
| sendall(38 from 38) -> (153) 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc) | sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc) | ||||
| sendall(9 from 9) -> (144) 4\\r\\n\x00\x00\x00:\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc) | ||||
| sendall(64 from 64) -> (80) 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n | sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n | ||||
| sendall(9 from 9) -> (71) 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) -> (62) 4\\r\\n\x00\x00\x00#\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc) | ||||
| sendall(41 from 41) -> (21) 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc) | sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc) | ||||
| sendall(9 from 9) -> (12) 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) -> (3) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | ||||
| sendall(3 from 5) -> (0) 0\r\n | sendall(3 from 5) -> (0) 0\r\n | ||||
| 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 -22 | $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -22 | ||||
| write(9 from 9) -> (756) 4\r\nHG20\r\n | write(9) -> 4\r\nHG20\r\n | ||||
| write(9 from 9) -> (747) 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) -> (738) 4\\r\\n\x00\x00\x00)\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc) | ||||
| write(47 from 47) -> (691) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | write(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc) | ||||
| write(9 from 9) -> (682) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc) | ||||
| write(473 from 473) -> (209) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc) | write(473) -> 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc) | ||||
| write(9 from 9) -> (200) 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) -> (191) 4\\r\\n\x00\x00\x00 \\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc) | ||||
| write(38 from 38) -> (153) 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc) | write(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc) | ||||
| write(9 from 9) -> (144) 4\\r\\n\x00\x00\x00:\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc) | ||||
| write(64 from 64) -> (80) 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n | write(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n | ||||
| write(9 from 9) -> (71) 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) -> (62) 4\\r\\n\x00\x00\x00#\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc) | ||||
| write(41 from 41) -> (21) 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc) | write(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc) | ||||
| write(9 from 9) -> (12) 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) -> (3) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | write(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc) | ||||
| write(3 from 5) -> (0) 0\r\n | write(3 from 5) -> (0) 0\r\n | ||||
| 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 | ||||
| $ rm -f error.log | $ rm -f error.log | ||||
| $ rm -rf clone | $ rm -rf clone | ||||