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

Re: Use mongoose to test smart-http unconditionally?

From
Jeff King <peff@peff.net>
Date
Dec 5, 2013, 03:00 UTC
Message-ID
<20131205030015.GB19376@sigill.intra.peff.net>
In-Reply-To
<20131204232800.GG29959@google.com>
On Wed, Dec 04, 2013 at 03:28:00PM -0800, Jonathan Nieder wrote:
Show 6 quoted lines
> For what it's worth, when I build git and run tests I tend to be in an
> environment with apache available, but I'm too lazy to configure git's
> tests to pick the right port and make sure it is reserved and so on.
> Perhaps there's some way to help lazy people in the same boat?  (E.g.,
> picking a port randomly and skipping instead of failing a test when
> it's taken or something)
What level of magic do you need?

For most people, "apt-get install apache && make GIT_TEST_HTTPD=yes test" is enough to run the tests. It uses ports in the 5000-range; this _can_ conflict with other services the user is running, but it should not usually (we don't match anything in a typical /etc/services file). And each script uses its own port, so running the tests in parallel is fine.

If you are planning on running "make test" from multiple git checkouts at the same time, though, they will conflict.

The failure mode is reasonable. You should get something like:
  $ GIT_TEST_HTTPD=1 LIB_HTTPD_PORT=80 ./t5540-http-push.sh
  1..0 # SKIP skipping test, web server setup failed

We could do better by retrying with a range of ports, but unless somebody really needs that, I'd prefer to avoid complicating it more.

The one thing I have occasionally run into is a stale apache hanging around. But I think that only happens when I am abusing the test script (e.g., sticking a test_pause in, poking around, and then not letting the script complete and do its cleanup).

So is the current behavior good enough to meet your needs and you didn't know it, or do we need more?

-Peff
Previous: Duy NguyenNext: Junio C Hamano
Message 6 of 10 in “Use mongoose to test smart-http unconditionally?”
  1. Duy NguyenDec 4, 2013
  2. Shawn PearceDec 4, 2013
  3. Jeff KingDec 4, 2013
  4. Jonathan NiederDec 4, 2013
  5. Duy NguyenDec 5, 2013
  6. Jeff KingDec 5, 2013
  7. Junio C HamanoDec 4, 2013
  8. Jeff KingDec 4, 2013
  9. Junio C HamanoDec 4, 2013
  10. Jeff KingDec 5, 2013

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.