• Michiel van Felius
  • 95 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 5
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.

as i wrote in the title i've got this issue. the two classes i use are those:
public class ContainsProvaTest {
    static testMethod void prova(){
        ContainsProva prova1 = new ContainsProva();

public with sharing class ContainsProva {
    public void contains() {
        String name = 'Rossella';
        boolean result = name.contains('Ros');
        System.debug('Result is' + result);

Both classes are inside an Apex sandbox project.


test configuration

What's wrong with that?

I read that it could be a bug of salesforce. Can anyone helps me?



I created a custom object and set the record name to text and now I realize that I need to set it to Auto-number. The problem is I cannot change it.
this object is included in my managed package so I cannot delete and recreate.

Is there a way around this?
I'll appreciate any help. Thanks
  • June 24, 2016
  • Like
  • 0
Hi,  I receive the following error in a test class but have not been able to repeat them in non test running scenarios.

"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. 
A flow trigger failed to execute the flow with version ID 301O00000008hM6. 
Contact your administrator for help.: []"

Does anyone know if there could be an issue running flows in test class contexts but not otherwise?


I use the password flow to get the access token like this:


curl -k https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=[clientid]" -d "client_secret=[clientsecret]" -d "username=[myusername]" -d "password=[mypassword][mysecuritytoken]"


which returns




Then I do


curl -k https://na15.salesforce.com/services/data/v27.0/chatter/users/me -H 'Authorization: Bearer 00D...vZ1'


but I get this error response:


[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

curl: (6) Could not resolve host: Bearer
curl: (6) Could not resolve host: 00D...vZ1'


Any idea of what is wrong?


  • April 26, 2013
  • Like
  • 0