Unable to run all Apex unit tests for a project ("UNKNOWN_EXCEPTION: An unknown exception occurred.")

Issue #1971 resolved
David Esposito created an issue

I’ll admit that I’ve never tried to run our entire suite of unit tests in IC before (1700 test methods) but I’m try to do it today and facing a problem.

I can successfully run tests on a single test class by clicking the green run icon in the gutter next to the class name.

However, when I right-click on the green run icon and do Edit Configuration and define a Run Configuration for All Tests (check the All Tests checkbox), I get the following (pages and pages of this) when kicking off the run.

Testing started at 12:34 PM ...

Using connection 'PatronTicketDiploUserMode'.
Error 500/Server Error - UNKNOWN_EXCEPTION: An unknown exception occurred.

Test ignored.

Test method IT_BatchCreatePortalUsers.BatchCreatePortalUsers_When_WhereClauseReturnsFiveTestContacts_Expect_FiveNewUsersWithUniqueNicknames was never reported as completed.
Perhaps it doesn't exist on the server?
Error 500/Server Error - UNKNOWN_EXCEPTION: An unknown exception occurred.

Test ignored.

Test method IT_BatchUpdateStreamRegistrations.BatchUpdateStreamRegistrations_When_Successful_Expect_HTTPCalloutsAndEventInstancesUpdated was never reported as completed.
Perhaps it doesn't exist on the server?
Error 500/Server Error - UNKNOWN_EXCEPTION: An unknown exception occurred.

Test ignored.

Test method IT_BenefitLevelControllerExt.getEarlyAccessDateList was never reported as completed.
Perhaps it doesn't exist on the server?
Error 500/Server Error - UNKNOWN_EXCEPTION: An unknown exception occurred.

Test ignored.

Test method IT_Controller_AutomationTemplate.cloneTemplate_Expect_RecordClonedSuccessfully was never reported as completed.
Perhaps it doesn't exist on the server?

Test ignored.

Test method IT_Controller_AutomationTemplate.deleteTemplate_Expect_RecordDeletedAndClearsSettingsAndTEs was never reported as completed.
Perhaps it doesn't exist on the server?

This is what my Run Configuration looks like:

I even tried unchecking the “All Tests” checkbox and picking only a single test class – same problem (UNKNOWN_EXCEPTION) – so there must be something wrong with this Run Config.

I saw that a version of IC long ago was supposed to enable a creation of a “Run All Tests” run configuration when creating a new project but this is a new project and I didn’t have any Run Configs so I had to create this one ‘by hand’.

What critical step am I missing here?

Comments (5)

  1. Scott Wells repo owner

    Given that you're getting a 500/Server Error, I'm not sure it's anything that you (or potentially IC2) are doing wrong. Typically when the local and server test classes are out of sync, you'd get a 403/Forbidden.

    I'm happy to look at a debug log, but before we do that, what happens if you right-click on a single test method and click Run TestName? Does that work?

  2. David Esposito reporter

    Sigh – this may be a case of exceeding my Async Apex Test execution in the org being masked by that UNKNOWN_EXCEPTION.

    When I tried to run all tests in the Apex Test Excecution panel in Setup, I got “AsyncApexTests Limit exceeded”

    I baked a brand new scratch org and now I’m able to run all tests using the run config I have in the screenshot above.

    Sorry about the false alarm. I’m sure in the million lines of errors when trying to run the tests in the old scratch org, the AsyncApexTests error was in there some where but I’ve nuked that scratch org so I can’t confirm.

  3. Log in to comment