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

Re: [PATCH] t9501: Skip testing load if we can't detect it

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2010, 18:31 UTC
Message-ID
<7vwryq1aid.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201002061505.13886.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 5 quoted lines
> or the test should use 
>
>   $maxload = -1;
>
> to artificially force 'load too high' situation.

One related thing that bugs me somewhat is that there is no corresponding test to make sure that "too loaded" does not trigger when it shouldn't. But it is harder to arrange (there is no safe $maxload value you can hardcode in the test and guarantee the system will not loaded that high), so you need to teach the get_loadavg() to lie under test only for the sake of running the test, which is backwards---so I'd say that is not worth it.

Here is my attempt to reword the commit log message from Brian (the "-1" one, squashed into a revert of the one from yesterday, the latter of which I already pushed out). I just added the first paragraph to better justify the reason why we are testing the codepath that would never be exercised in real life on platforms that lack /proc/loadavg.

    Subject: t9501: Re-fix max load test
    Revert the previous attempt to skip this test on platforms where we
    currently cannot determine the system load.  We want to make sure that
    the max-load-limit codepath produces results cleanly, when gitweb is
    updated and becomes capable of reading the load average by some other
    method.
    The code to check for load returns 0 if it doesn't know how to find
    load.  It also checks to see if the current load is higher than the
    max load.  So to force the script to quit early by setting the maxload
    variable negative which should work for systems where we can detect
    load (which should be a positive number) and systems where we can't
    (where detected load is 0)
    Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Previous: Jakub NarebskiNext: Brian Gernhardt
Message 7 of 8 in “t9501: Skip testing load if we can't detect it”
  1. t9501: Skip testing load if we can't detect itBrian Gernhardt, Feb 6, 2010
  2. Jakub NarebskiFeb 6, 2010
  3. Brian GernhardtFeb 6, 2010
  4. Jakub NarebskiFeb 6, 2010
  5. t9501: Correctly force over max load everywhereBrian Gernhardt, Feb 6, 2010
  6. Jakub NarebskiFeb 6, 2010
  7. Junio C HamanoFeb 6, 2010
  8. Brian GernhardtFeb 6, 2010

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.