• Andree Wille
  • NEWBIE
  • 5 Points
  • Member since 2012
  • Freelance Salesforce Developer & Consultant
  • Andree Wille


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi,

i get an UNABLE_TO_LOCK_ROW  error when running my tests in parallel. The error occurs when creating a pricebookentry in the standard pricebook. As far as i know Salesforce locks also the parent Object when inserting a object. Which would mean that in this case while inserting the pricebookentry the pricebook is locked. When now a parallel test wants to add another entry to the locked pricebook the test throws the UNABLE_TO_LOCK_ROW error.

Does anyone know how to get around this?
I am running into a very strange issue with my unit tests.  When I run each test or test class individually they all pass fine.  The problem occurs when I try to run multiple tests at once or a test suite I put together.  I've been using case assignment rules to put new cases into queues and they work fine.  The problem I've found from going through the debug logs is that when more than one test is run at once, the case assignment rules never get called.  Going through the logs I don't even see them mentioned though other custom workflows do get triggered.

Does salesforce skip case assignment rules when running large tests?  If so will this cause a failure for deployment to production and if it will is there a way to make the case assignment rules fire?
Hi,

i get an UNABLE_TO_LOCK_ROW  error when running my tests in parallel. The error occurs when creating a pricebookentry in the standard pricebook. As far as i know Salesforce locks also the parent Object when inserting a object. Which would mean that in this case while inserting the pricebookentry the pricebook is locked. When now a parallel test wants to add another entry to the locked pricebook the test throws the UNABLE_TO_LOCK_ROW error.

Does anyone know how to get around this?