function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lokeswara ReddyLokeswara Reddy 

CPU time out error with test class

Hi All,

Any best practices around handling CPU time out error for test classes?
The error from the deployment really doesn't give any clue on why it is taking too long for test class execution.

Regards
Lokesh
Michiel van FeliusMichiel van Felius
With the new summer '19 release I also notice more CPU time limit errors. I think this is releated to the 'fix' of 'Apex CPU time limit is not enforced if an Apex test runs in synchronous mode': https://success.salesforce.com/issues_view?id=a1p3A0000008q7VQAQ

However the best way to debug the timeout is by using the Developer Console Log Panels (Stack tree, Execution Stack, Execution Overview) which you can find by navigating to Developer Console -> Debug -> View Log Panels..

Kind regards,

Michiel