Homec4science

Fix lock tests under Ubuntu/dash

Authored by epriestley <git@epriestley.com> on Feb 19 2013, 06:04.

Description

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

Details

Committed
epriestley <git@epriestley.com>Feb 19 2013, 06:04
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUb23c019a2817: When there is only one translation variant, always select it
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUfde6d284217f: Fix lock tests under Ubuntu/dash (authored by epriestley <git@epriestley.com>).Feb 19 2013, 06:04