From: Kaartic Sivaraam Date: Thu, 19 Nov 2026 17:33:32 GMT Subject: Re: [PATCH v2] test-lib: run EXPENSIVE tests one at a time Message-ID: <2bcce580-f5ed-47e9-bd3e-1e238eb90d5c@gmail.com> In-Reply-To: <20261119-ks-ci-long-test-hang-fix-v2-1-37011c08380d@gmail.com> On 11/19/26 22:59, Kaartic Sivaraam wrote: > Changes in v2: > - Corrected commit messages as per Patrick's suggestions > - Tweaked the shell function comment to avoid mentioning 'prove --jobs' > - Made the owner and waiting variables local within acquire_expensive_lock_ > > Link to v1: https://patch.msgid.link/20261119-ks-ci-long-test-hang-fix-v1-1-45c2fff6d9f0@gmail.com I thought b4 would've included it by itself. Anyways, here's the range-diff: 1: f0664ff4ee ! 1: fbf773f39a test-lib: run EXPENSIVE tests one at a time @@ Metadata ## Commit message ## test-lib: run EXPENSIVE tests one at a time - Recently, we've acquired quite a few expensive test in our test suite. + Recently, we've acquired quite a few expensive tests in our test suite. For instance, these commits add several tests that require - multi-gigabytes: + multi-gigabytes of memory: - 9048b48fb (t1600-index: add expensive tests for over-long tree paths, 2026-10-16) added tests to t1600 @@ t/test-lib.sh: fail_117 () { return 117 } -+# EXPENSIVE tests can need many gigabytes of memory or disk, so two of -+# them running at the same time under "prove --jobs" can exhaust the -+# machine. Allow only one at a time across all test scripts that share ++# EXPENSIVE tests may need many gigabytes of memory or disk, so two of ++# them running at the same time can exhaust the machine. ++# ++# Allow only one at a time across all test scripts that share +# this TEST_OUTPUT_DIRECTORY. +expensive_lock_="$TEST_RESULTS_DIR/expensive.lock" +have_expensive_lock_= + +acquire_expensive_lock_ () { ++ local owner waited= + mkdir -p "$TEST_RESULTS_DIR" || return 1 + while ! mkdir "$expensive_lock_" 2>/dev/null + do @@ t/test-lib.sh: fail_117 () { + rm -rf "$expensive_lock_" + continue + fi -+ if test -z "$expensive_lock_waited_" ++ if test -z "$waited" + then + say >&3 "waiting for another EXPENSIVE test to finish" -+ expensive_lock_waited_=t ++ waited=t + fi + sleep 1 + done -+ expensive_lock_waited_= + echo $$ >"$expensive_lock_/pid" + have_expensive_lock_=t +} -- Sivaraam