Many of our unit tests running on any SF org version Summer '13 and above are now randomly failing with the error: "UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record" when parallel unit testing is enabled. These unit tests had previously always passed.
Doing our initial investigation, we discovered that this appears to happen on our unit tests that are trying to access and update our public custom settings object - it's as though public custom setting objects are no longer isolated per unit test.
We discovered that the way around this was to check the "Disable Parallel Apex Testing" option, but that solution is not ideal for us since we have over 850 unit tests. It now takes considerably more time to verify that our development does not break any of our code.
We filed a case and the response was that the systems is “working as expected” and the only resolution was to disable parallel testing.
We are aware that other enterprise developers with a substantial number of tests are experiencing the same problem.
This idea is for Salesforce to fix the underlying problem, which was introduced in Spring 2013. If the problem was introduced by another change, then we should find another way to introduce that change without breaking an existing feature.