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
robert webber 8robert webber 8 

Developer console checkpoints not working in unit tests

Checkpoints don't fire when set in a unit test method or any method called by a unit test method. It was working a few weeks ago and it just stopped working. They work if I invoke code from the app UI. Not sure if it has anything to do with it, but I create a role as administrator in the test setup and do a RunAs this administrator, but this hasn't changed.

Below is my log level setup. Doesn't make any difference if I set to Finer or Finest.

Any ideas?

Change Log Level setup

 
AbhishekAbhishek (Salesforce Developers) 
Hi Robert,

Your query is answered in the below blogs,

https://salesforce.stackexchange.com/questions/46172/do-checkpoints-work-with-unit-tests#:~:text=The%20trick%20here%20is%20you,column%20is%20set%20to%20Finer.

https://developer.salesforce.com/forums/?id=906F0000000AzRgIAK

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
robert webber 8robert webber 8
Well, it kind of worked when I unchecked "Show my current checkpoints only". I could see the checkpoints in the methods called from the unit test, but not any in the unit test itself. But, the checkpoints were from hour ago. I tried again this morning. I saw the checkpoint in the method once, but it did not appear when I reran it. Seems like these checkpoints are long delayed.

Anyway, I removed the "RunAs" statement in my unit test and everything worked like it used to (did no have to uncheck the box). I have no idea why this changed. I will just  have to remove the RunAs when I'm debugging a unit test.

Thamk you for your help.
AbhishekAbhishek (Salesforce Developers) 
That's great news, at-last, my suggestion worked. please mark as Best Answer to help others too.

Thanks.