<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-httpd.sh, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-08-02T22:30:39Z</updated>
<entry>
<title>Merge branch 'sg/httpd-test-unflake'</title>
<updated>2018-08-02T22:30:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc6d33e87ac930286fe0bfc882b837bba4b18501'/>
<id>urn:sha1:bc6d33e87ac930286fe0bfc882b837bba4b18501</id>
<content type='text'>
httpd tests saw occasional breakage due to the way its access log
gets inspected by the tests, which has been updated to make them
less flaky.

* sg/httpd-test-unflake:
  t/lib-httpd: avoid occasional failures when checking access.log
  t/lib-httpd: add the strip_access_log() helper function
  t5541: clean up truncating access log
</content>
</entry>
<entry>
<title>t/lib-httpd: avoid occasional failures when checking access.log</title>
<updated>2018-07-12T17:40:31Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-07-12T12:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8b3b2e275106c4fae1fb2b5969924a4565615e6'/>
<id>urn:sha1:e8b3b2e275106c4fae1fb2b5969924a4565615e6</id>
<content type='text'>
The last test of 't5561-http-backend.sh', 'server request log matches
test results' may fail occasionally, because the order of entries in
Apache's access log doesn't match the order of requests sent in the
previous tests, although all the right requests are there.  I saw it
fail on Travis CI five times in the span of about half a year, when
the order of two subsequent requests was flipped, and could trigger
the failure with a modified Git.  However, I was unable to trigger it
with stock Git on my machine.  Three tests in
't5541-http-push-smart.sh' and 't5551-http-fetch-smart.sh' check
requests in the log the same way, so they might be prone to a similar
occasional failure as well.

When a test sends a HTTP request, it can continue execution after
'git-http-backend' fulfilled that request, but Apache writes the
corresponding access log entry only after 'git-http-backend' exited.
Some time inevitably passes between fulfilling the request and writing
the log entry, and, under unfavourable circumstances, enough time
might pass for the subsequent request to be sent and fulfilled by a
different Apache thread or process, and then Apache writes access log
entries racily.

This effect can be exacerbated by adding a bit of variable delay after
the request is fulfilled but before 'git-http-backend' exits, e.g.
like this:

  diff --git a/http-backend.c b/http-backend.c
  index f3dc218b2..bbf4c125b 100644
  --- a/http-backend.c
  +++ b/http-backend.c
  @@ -709,5 +709,7 @@ int cmd_main(int argc, const char **argv)
   					   max_request_buffer);

   	cmd-&gt;imp(&amp;hdr, cmd_arg);
  +	if (getpid() % 2)
  +		sleep(1);
   	return 0;
   }

This delay considerably increases the chances of log entries being
written out of order, and in turn makes t5561's last test fail almost
every time.  Alas, it doesn't seem to be enough to trigger a similar
failure in t5541 and t5551.

So, since we can't just rely on the order of access log entries always
corresponding the order of requests, make checking the access log more
deterministic by sorting (simply lexicographically) both the stripped
access log entries and the expected entries before the comparison with
'test_cmp'.  This way the order of log entries won't matter and
occasional out-of-order entries won't trigger a test failure, but the
comparison will still notice any unexpected or missing log entries.

OTOH, this sorting will make it harder to identify from which test an
unexpected log entry came from or which test's request went missing.
Therefore, in case of an error include the comparison of the unsorted
log enries in the test output as well.

And since all this should be performed in four tests in three test
scripts, put this into a new helper function 'check_access_log' in
't/lib-httpd.sh'.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/lib-httpd: add the strip_access_log() helper function</title>
<updated>2018-07-12T17:40:31Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2018-07-12T12:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6940a0602267a4b9ce328bc0f29784253b3df58d'/>
<id>urn:sha1:6940a0602267a4b9ce328bc0f29784253b3df58d</id>
<content type='text'>
Four tests in three httpd-related test scripts check the contents of
Apache's 'access.log', and they all do so by running 'sed' with the
exact same script consisting of four s/// commands to strip
uninteresting log fields and to vertically align the requested URLs.

Extract this into a common helper function 'strip_access_log' in
'lib-httpd.sh', and use it in all of those tests.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>upload-pack: test negotiation with changing repository</title>
<updated>2018-06-28T16:33:29Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-06-27T22:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3374292e55564fa6107b31a63a5e5432cd8c2265'/>
<id>urn:sha1:3374292e55564fa6107b31a63a5e5432cd8c2265</id>
<content type='text'>
Add tests to check the behavior of fetching from a repository which
changes between rounds of negotiation (for example, when different
servers in a load-balancing agreement participate in the same stateless
RPC negotiation). This forms a baseline of comparison to the ref-in-want
functionality (which will be introduced to the client in subsequent
commits), and ensures that subsequent commits do not change existing
behavior.

As part of this effort, a mechanism to substitute strings in a single
HTTP response is added.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ew/git-svn-http-tests'</title>
<updated>2016-08-08T21:48:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-08T21:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=612c3dfb06675bf65831a7eb8b51ecc57224f5ef'/>
<id>urn:sha1:612c3dfb06675bf65831a7eb8b51ecc57224f5ef</id>
<content type='text'>
Tests for "git svn" have been taught to reuse the lib-httpd test
infrastructure when testing the subversion integration that
interacts with subversion repositories served over the http://
protocol.

* ew/git-svn-http-tests:
  git svn: migrate tests to use lib-httpd
  t/t91*: do not say how to avoid the tests
</content>
</entry>
<entry>
<title>git svn: migrate tests to use lib-httpd</title>
<updated>2016-07-25T17:42:34Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2016-07-23T04:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8a5d2511871caec259036af95d7dd6287d12925'/>
<id>urn:sha1:a8a5d2511871caec259036af95d7dd6287d12925</id>
<content type='text'>
This allows us to use common test infrastructure and parallelize
the tests.  For now, GIT_SVN_TEST_HTTPD=true needs to be set to
enable the SVN HTTP tests because we reuse the same test cases
for both file:// and http:// SVN repositories.  SVN_HTTPD_PORT
is no longer honored.

Tested under Apache 2.2 and 2.4 on Debian 7.x (wheezy) and
8.x (jessie), respectively.

Cc: Clemens Buchacher &lt;drizzd@aon.at&gt;
Cc: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>lib-httpd.sh: print error.log on error</title>
<updated>2016-06-13T18:50:44Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-13T12:35:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44f243d356a6402878b2b3e098fd8cfa4fe1aaf5'/>
<id>urn:sha1:44f243d356a6402878b2b3e098fd8cfa4fe1aaf5</id>
<content type='text'>
Failure to bring up httpd for testing is not considered an error, so the
trash directory, which contains this error.log file, is removed and we
don't know what made httpd fail to start. Improve the situation a bit,
print error.log but only in verbose mode.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/lib-httpd.sh: use the $( ... ) construct for command substitution</title>
<updated>2015-12-27T23:33:13Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2015-12-22T14:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e429dfd5e49e8eb5471ae82cfdd9a86bc1f587f4'/>
<id>urn:sha1:e429dfd5e49e8eb5471ae82cfdd9a86bc1f587f4</id>
<content type='text'>
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/skip-http-tests-under-no-curl'</title>
<updated>2015-05-22T19:41:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-22T19:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8087a620863dde1c589f072abd4e6b9ef1017a62'/>
<id>urn:sha1:8087a620863dde1c589f072abd4e6b9ef1017a62</id>
<content type='text'>
Test clean-up.

* jk/skip-http-tests-under-no-curl:
  tests: skip dav http-push tests under NO_EXPAT=NoThanks
  t/lib-httpd.sh: skip tests if NO_CURL is defined
</content>
</entry>
<entry>
<title>tests: skip dav http-push tests under NO_EXPAT=NoThanks</title>
<updated>2015-05-07T16:48:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-07T16:06:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=309a9e33731a56487944dbaa00073f8ee05c9f70'/>
<id>urn:sha1:309a9e33731a56487944dbaa00073f8ee05c9f70</id>
<content type='text'>
When built with NO_EXPAT=NoThanks, we will not have a working http-push
over webdav.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
