In the last 24 hours several of our Jenkins (Continuous Integration server) builds have started failing with:

System.LimitException: Apex CPU time limit exceeded

exceptions in unit tests that have been passing for many months. It is as if the limit counting has changed in some manner.

Anyone else experiencing this, or have an insight into what is going on?

  • Keith C.. Are you getting this error against sandbox or production means while CI process? .. I think Salesforce may be changed/updated anything in sandbox but not in production I think.
    – Ratan Paul
    Apr 7, 2016 at 10:19
  • @sfdcweb Our CI server runs the tests in developer edition orgs.
    – Keith C
    Apr 7, 2016 at 10:30
  • 1
    Weird but looks like in one of sandbox I am also receiving same error but after few hours now everything back to normal.. seems weird.. seems like salesforce resource is not available properly at that time..
    – Ratan Paul
    Apr 7, 2016 at 14:29
  • I have been getting it for over 24 hours now when running CI in a sandbox
    – BarCotter
    Apr 7, 2016 at 15:42

4 Answers 4


Salesforce support have confirmed that the "Apex CPU time limit exceeded” was caused from a patch that they applied and have since rolled back. This issue would of affected dev orgs, sandboxes and production instances.

There was no Known Issue created for this problem.


I know this is not an answer but I don't have enough rep to comment

We have experienced this in 2 of our CI ORGs which are mapped to 2 different code bases (one of them hasn't changed in about a month).

From what I can see the CPU time limit seems to be coming from the Salesforce String/Matcher classes.

Just wanted to give you what I have seen so far, maybe it can spark an idea from somebody out there who can give a hand.

UPDATE: Finally heard back from Salesforce that they pushed a patch to the Spring '16 update. The issue was around the handler for the Apex Logs on the Salesforce side that was using a large amount of the heap.

As of yesterday, they have rolled back that change and now things appear to be working for me.

  • Thanks for adding this - +1 from me for knowing we are not alone in this...
    – Keith C
    Apr 7, 2016 at 15:37
  • I found that there were 2 reasons that I was hitting the CPU limit. One was a method that was being called in a number of test classes that was loading a CSV file, parsing it, and creating objects from that CSV. The other was an Apex test that creates 500 objects (testing the max nightly workflow limit) and updates them to test that the triggers don't throw any SOQL or DML errors. Once I commented out the one test and the data setup in my tests I was able to move past the failing tests. Apr 8, 2016 at 14:06
  • Also noticed that the tests that were failing when running them locally went from taking 8-10 seconds to execute previous to these errors to over 30 seconds triggering the Apex CPU Limit. Still have no idea on root cause of the error. Apr 8, 2016 at 14:09

Please find the KI : https://success.salesforce.com/issues_view?id=a1p300000008Y6EAAU

Can you implement the workaround.

  • Thanks for this, but it is not the problem as the Apex tests do not open any Visualforce pages and also the CI build orgs do not have logging turned on.
    – Keith C
    Apr 8, 2016 at 11:56

I noticed this problem while running unit tests in a newly created sandbox. Then I ran all unit tests on production and found out that the problem exists there as well. These unit tests were running fine in Spring'16, but one of them is failing in Summer'16. I have the test history to prove it. The unit tests do not use existing data.

I suggest everybody run their unit tests, to find out if you have problems, before you find out when doing a deployment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .