diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t1400-update-ref.sh | 9 | ||||
-rwxr-xr-x | t/t5324-split-commit-graph.sh | 13 | ||||
-rw-r--r-- | t/test-lib.sh | 9 |
3 files changed, 22 insertions, 9 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 48d0d42afd..e1197ac818 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -1354,15 +1354,6 @@ test_expect_success 'fails with duplicate ref update via symref' ' test_cmp expect actual ' -run_with_limited_open_files () { - (ulimit -n 32 && "$@") -} - -test_lazy_prereq ULIMIT_FILE_DESCRIPTORS ' - test_have_prereq !MINGW,!CYGWIN && - run_with_limited_open_files true -' - test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' ' ( for i in $(test_seq 33) diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index 3378ec54cd..4146b82031 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -387,4 +387,17 @@ test_expect_success '--split=replace replaces the chain' ' graph_read_expect 2 ' +test_expect_success ULIMIT_FILE_DESCRIPTORS 'handles file descriptor exhaustion' ' + git init ulimit && + ( + cd ulimit && + for i in $(test_seq 64) + do + test_commit $i && + test_might_fail run_with_limited_open_files git commit-graph write \ + --split=no-merge --reachable || return 1 + done + ) +' + test_done diff --git a/t/test-lib.sh b/t/test-lib.sh index 13ba00d508..1b221951a8 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1666,6 +1666,15 @@ test_lazy_prereq ULIMIT_STACK_SIZE ' run_with_limited_stack true ' +run_with_limited_open_files () { + (ulimit -n 32 && "$@") +} + +test_lazy_prereq ULIMIT_FILE_DESCRIPTORS ' + test_have_prereq !MINGW,!CYGWIN && + run_with_limited_open_files true +' + build_option () { git version --build-options | sed -ne "s/^$1: //p" |