Kaartic Sivaraam's patch addresses a CI problem. Git has recently gained several tests that need multiple gigabytes of memory: new expensive tests in t1600, t4300 and t4141, plus the existing 5GB filtered hash-object test in t1007. With GIT_TEST_LONG set, running them concurrently exhausted memory on the 16GB GitLab CI runners.
The patch makes EXPENSIVE tests run one at a time through a lock. The lock records the owner's PID, and a lock whose owner no longer exists is pruned.
Patrick Steinhardt said he would like the problem resolved soon because the pipelines are currently a mess. His review comments were mostly about the commit message. He asked what the "multi-gigabytes" referred to, and Kaartic's later revision says "multi-gigabytes of memory". He also asked that the message not single out prove --jobs, since tests also run concurrently through the plain Makefile or Meson. Kaartic agreed to remove that part. Steinhardt also questioned how the script uses file descriptor 3.
Steinhardt noted that two processes racing for the lock are protected by checking whether a PID could be read at all. Kaartic acknowledged a remaining race. If two waiters see the same dead PID and a holder was SIGKILLed, one could delete a live lock just created by the other. He called this rare and said he would not complicate the code to handle it. The worst case is two expensive tests running instead of one.
Revised versions with a range-diff have been posted, and the review is ongoing.