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

[PATCH 2/2] test-lib: ulimit does not limit on CYGWIN and MINGW

From
Michael J Gruber <git@grubix.eu>
Date
Sep 14, 2017, 14:52 UTC
Message-ID
<00b6d2a5508520635956da1d2db656bca126cd1a.1505400392.git.git@grubix.eu>
In-Reply-To
<alpine.DEB.2.21.1.1709141440510.4132@virtualbox>
ulimit succeeds (by return value) but does not limit on some systems.

Set ulimit() to false on these systems so that we do not rely on its output nor effect. As an intended side-effect, ulimit based prerequisites are set correctly (to "not-have") on these systems.

Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reported-by: Adam Dinwoodie <adam@dinwoodie.org>
Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Michael J Gruber <git@grubix.eu>
---
This is independent of my series, but should best go before so that no
ulimit based test is run on CYGWIN and MINGW.

It follows the basic assumption that a tool like ulimit is either present and functional or not present; and that we work around by defines or such when that assumption is broken. (Alternatively, we could set ULIMT_LIMITS or so and depend on that.)

 t/test-lib.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b8a0b05102..f6ac60d487 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -998,6 +998,10 @@ case $uname_s in
 	mkfifo () {
 		false
 	}
+	# ulimit succeeds but does not limit
+	ulimit () {
+		false
+	}
 	# no POSIX permissions
 	# backslashes in pathspec are converted to '/'
 	# exec does not inherit the PID
@@ -1012,6 +1016,10 @@ case $uname_s in
 	mkfifo () {
 		false
 	}
+	# ulimit succeeds but does not limit
+	ulimit () {
+		false
+	}
 	test_set_prereq POSIXPERM
 	test_set_prereq EXECKEEPSPID
 	test_set_prereq CYGWIN
-- 
2.14.1.712.gda4591c8a2
Previous: Johannes SchindelinNext: Ramsay Jones
Message 10 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.