1

When I run any test class other developers see issue like below while saving classes in the developer console:

The changes you requested require salesforce.com to temporarily lock your organization's administration setup. However, the administration setup has already been locked by another change. Please wait for the previous action to finish, then try again later.

We need to keep going development and unit testing.

How can we do both on the org without the Organization Lock issue?

2 Answers 2

1

This happens because there is another process running and doing some type of update, insert, running tests, etc to your org. You need to make sure that perhaps there is not other running operation on the same time you are tying to do your modifications.

I experienced this a few times on a scratch org created by Jenkins. If I push changes to the org, which it is connected to a branch, and on the same time I try to make changes directly to the org from my Intellij, the error will show.

So the bottom line is that you org is under a process at the time you are trying to do some new operations. The first process locks you org and you need to wait until it is done in order two execute the second operation.

I will suggest to have some type of pipelines in your development life cycle...

2
  • The other developers get issue while saving in the developer console. I am not sure if we can use something like Pipeline in there. A bit more details will help. Dec 14, 2019 at 16:02
  • Are you using real data on the tests you are running? Can you post the code that is part of those test? Will be nice to have a look to the code before. Dec 14, 2019 at 18:23
1

The root problem is that you have multiple developers working in a single org (and even worse, doing so via Developer Console). This is not a recommended practice and can lead to lots of challenges, including overwriting one another's changes and other species of mutual interference.

There are a wide variety of development operations that can cause different portions of an organization's setup to be locked while they complete. (See this article for a partial list; note that deployments can also cause setup locks, and saving a class in Developer Console is a deployment). You can't turn off or manipulate these locks per se, although you can try to understand what causes them and alter your processes to reduce their impact - for example, scheduling much smaller test runs, or choosing when to run tests.

The best solution, though, is to stop sharing orgs for development. Use multiple Developer Editions or Developer sandboxes, or best of all use scratch orgs. Practice source control, and use a proper IDE, not Developer Console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.