Fix lock tests under Ubuntu/dash
Summary:
On Ubuntu, the default sh is dash, which (unlike bash) remains around in the process tree when you run shell commands (see the dozen similar bugs this has caused).
During these tests, we spawn and then kill subprocesses fairly aggressively. With dash, the subshell eats the SIGKILL and the grandchild process is left hanging around, holding the lock.
Instead, use exec to vanish the intermediate shell process so we can SIGKILL the lock holder directly.
Fixes T2560.
Test Plan:
ubuntu@ip-10-170-222-96:/core/libphutil$ uname -a Linux ip-10-170-222-96 3.0.0-16-virtual #29-Ubuntu SMP Tue Feb 14 13:27:41 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux ubuntu@ip-10-170-222-96:/core/libphutil$ ../arcanist/bin/arc unit src/filesystem/__tests__/PhutilFileLockTestCase.php PASS <1ms★ testLogWriteFailure PASS 120ms testManyWriters PASS 5ms★ testLogging PASS 146ms testLockHolding PASS 2ms★ testIsLocked PASS <1ms★ testExcessiveUnlock PASS 147ms testUnlockAll PASS <1ms★ testRelock PASS 90ms testLockTesting PASS 119ms testInProcessLocking PASS 106ms testInProcessHolding
Reviewers: Afaque_Hussain, chad
Reviewed By: chad
CC: aran
Maniphest Tasks: T2560
Differential Revision: https://secure.phabricator.com/D5008