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

Re: [PATCH] test-lib: don't use ulimit in test prerequisites on cygwin

From
Michael J Gruber <git@grubix.eu>
Date
Sep 14, 2017, 08:13 UTC
Message-ID
<6a413ecf-47d6-e562-7cdd-e4c3a1d666e6@grubix.eu>
In-Reply-To
<20170913192038.GH27425@aiede.mtv.corp.google.com>
Jonathan Nieder venit, vidit, dixit 13.09.2017 21:20:
Show 27 quoted lines
> Ramsay Jones wrote:
> 
>> On cygwin (and MinGW), the 'ulimit' built-in bash command does not have
>> the desired effect of limiting the resources of new processes, at least
>> for the stack and file descriptors. However, it always returns success
>> and leads to several test prerequisites being erroneously set to true.
>>
>> Add a check for cygwin and MinGW to the prerequisite expressions, using
>> 'uname -s', and return false instead of (indirectly) using 'ulimit'.
>> This affects the prerequisite expressions for the ULIMIT_STACK_SIZE,
>> CMDLINE_LIMIT and ULIMIT_FILE_DESCRIPTORS prerequisites.
>>
>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
>> ---
>>  t/t1400-update-ref.sh | 11 ++++++++++-
>>  t/t6120-describe.sh   |  1 -
>>  t/t7004-tag.sh        |  1 -
>>  t/test-lib.sh         | 22 ++++++++++++++++++++--
>>  4 files changed, 30 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> 
> Thanks.
> 
> An alternative would be to do some more explicit feature-based test
> like using "ulimit" to set a limit and then reading back the limit in
> a separate process, but that feels like overkill.

It's still not clear whether these limits would be in effect or just reported.

Rather than checking uname -s in several places, I think we should just define ulimit to be false in one place, or rather set the prerequisite there.

Michael
Previous: Jonathan NiederNext: Johannes Schindelin
Message 3 of 11 in “test-lib: don't use ulimit in test prerequisites on cygwin”
  1. test-lib: don't use ulimit in test prerequisites on cygwinRamsay Jones, Sep 13, 2017
  2. Jonathan NiederSep 13, 2017
  3. Michael J GruberSep 14, 2017
  4. Johannes SchindelinSep 14, 2017
  5. 1/2 test-lib: group system specific FIFO tests by systemMichael J Gruber, Sep 14, 2017
  6. Johannes SchindelinSep 14, 2017
  7. Michael J GruberSep 15, 2017
  8. Ramsay JonesSep 15, 2017
  9. Johannes SchindelinSep 15, 2017
  10. 2/2 test-lib: ulimit does not limit on CYGWIN and MINGWMichael J Gruber, Sep 14, 2017
  11. Ramsay JonesSep 14, 2017

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.