git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: t5539 fails on ubuntu for v2.0.0-rc2

From
Jeff King <peff@peff.net>
Date
May 10, 2014, 14:02 UTC
Message-ID
<20140510140259.GA6836@sigill.intra.peff.net>
In-Reply-To
<xmqqy4yavewk.fsf@gitster.dls.corp.google.com>
On Fri, May 09, 2014 at 02:08:27PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> >   3. Just disable the http tests when run as root.
> >
> > I think I'd favor 3. But I'd like to be sure that being root is the
> > problem.
> 
> I agree with both the conclusion and the precondition.
Here's the patch.

The problem starts in v1.9.2, not in v2.0.0, so it's not technically a regression in this cycle. And we are awfully late in the -rc period. But it is just a change in the test script, and one that seems rather unlikely to produce unexpected side effects. I'll leave it you whether you want to queue it for v2.0.0, or for the next maint release.

-- >8 --
Subject: t/lib-httpd: require SANITY prereq

Our test httpd setup will not generally run as root, because Apache will want to setuid, and we do not set up the "User" config directive. On some systems, like current Debian unstable, Apache fails to start, and we skip the tests:

    $ sudo ./t5539-fetch-http-shallow.sh --debug
    1..0 # SKIP web server setup failed
    $ cat trash*t5539*/httpd/error.log
    [...]
    (22)Invalid argument: AH00024: Couldn't set permissions on
      the rewrite-map mutex; check User and Group directives
    AH00016: Configuration Failed

However, on other systems (reportedly Ubuntu 11.04), Apache seems to start, and then bails during our tests with:

   getpwuid: couldn't determine user name from uid 4294967295,
     you probably need to modify the User directive
   Child 12037 returned a Fatal error...  Apache is exiting!

This may be related to the pre-fork/threading model in use (note that the second one complains of the child dying). However, it's not even worth investigating; in either case we just want to skip the tests, and we already recommend against running the test suite as root. Let's just explicitly check this condition and skip the tests rather than expecting Apache to do the right thing.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 252cbf1..8b67021 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -37,6 +37,11 @@ then
 	test_done
 fi
 
+if ! test_have_prereq SANITY; then
+	test_skip_or_die $GIT_TEST_HTTPD \
+		"Cannot run httpd tests as root"
+fi
+
 HTTPD_PARA=""
 
 for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
-- 
2.0.0.rc1.436.g03cb729
Previous: Junio C HamanoNext: Jeff King
Message 9 of 15 in “t5539 fails on ubuntu for v2.0.0-rc2”
  1. Fabio D'AlfonsoMay 7, 2014
  2. Junio C HamanoMay 7, 2014
  3. Jeff KingMay 8, 2014
  4. Fabio D'AlfonsoMay 8, 2014
  5. Fabio D'AlfonsoMay 8, 2014
  6. Jeff KingMay 9, 2014
  7. Fabio D'AlfonsoMay 9, 2014
  8. Junio C HamanoMay 9, 2014
  9. Jeff KingMay 10, 2014
  10. Jeff KingMay 14, 2014
  11. Junio C HamanoMay 14, 2014
  12. Jeff KingMay 14, 2014
  13. Fabio D'AlfonsoMay 8, 2014
  14. Fabio D'AlfonsoMay 9, 2014
  15. Jeff KingMay 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.