Patchwork D12055: test-http-bad-server: move on test from bytes-count to pattern

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2022, 2:48 p.m.
Message ID <differential-rev-PHID-DREV-lrr7qetnnbap5wmrs4sq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50381/
State New
Headers show

Comments

phabricator - Jan. 24, 2022, 2:48 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12055

AFFECTED FILES
  tests/test-http-bad-server.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-http-bad-server.t b/tests/test-http-bad-server.t
--- a/tests/test-http-bad-server.t
+++ b/tests/test-http-bad-server.t
@@ -563,7 +563,9 @@ 
 Server stops before it sends transfer encoding
 ----------------------------------------------
 
-  $ hg serve --config badserver.close-after-send-bytes=954 -p $HGPORT -d --pid-file=hg.pid -E error.log
+  $ hg serve \
+  > --config badserver.close-after-send-patterns="Transfer-Encoding: chunke" \
+  > -p $HGPORT -d --pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
@@ -584,7 +586,7 @@ 
 
 #else
   $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -7
-  write(41 from 41) -> (25) Content-Type: application/mercurial-0.2\r\n
+  write(41) -> Content-Type: application/mercurial-0.2\r\n
   write(25 from 28) -> (0) Transfer-Encoding: chunke
   write limit reached; closing socket
   $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)