Salesforce Test Classes never complete

I recently ran in to an issue where my test classes were running and running but never completing. It being close to Summer 20 release I thought it would resolve itself and literally let one test class running for days/over the weekend. I tried multiple sandboxes/instances so I was pretty sure it was on the Salesforce side. Well…turns out that for whatever reason I needed start a ‘Compile all classes’ under Setup –> Apex Classes. This is one of those things that I have used in the past but use so infrequent that I forgot. So remember if your test classes fail to complete and just sit there spinning to do a compile all classes and checked for errors.

Some notes, I was running tests async. Running classes synchronously (that is a mouthful) was running but I’m lazy and like to check the class coverage with the async checkbox checked. Also if your class is ‘stuck’ you will have to go to ‘Apex Test Execution’ under setup and cancel/abort the test before you can resubmit the test.

Leave a Reply

Your email address will not be published. Required fields are marked *