This can occur when running tests in ‘sync’ mode. This happens when a tests requires salesforce.com to temporarily lock your organization’s administration setup. However, the administration setup has already been locked by another change (or a previously incomplete test).
As of CodeScan version 3.5d you can choose to run the tests in two new modes:
- async - tests are queued and the results polled until completion
- history - previous test run results are used. In this mode, test data may be old or non-existent
If you choose to continue using ‘synchronous execution’, this information may help
Please wait for the previous action to finish, then try again later. The problem may be related to: https://success.salesforce.com/issues_view?id=a1p3A000000E1YYQA0
The error is intermittent and occurs in developer console or any other tool which uses Salesforce Tooling API.
May also be remedied by enabling and coding correctly for Parallel Test Execution.
- From Setup, enter Apex Test Execution in the Quick Find box, select Apex Test Execution, then click Options….
- In the Apex Test Execution Options dialog, deselect Disable Parallel Apex Testing and then click OK.
- Some testing code may need to be updated. See the Best Practises for Testing section