Salesforce 2020 release has blocked all Apex tests that use http mocking

This should now be fixed, Summer '20 patch 7 is live on almost all Summer 20 sandbox pods as of this edit

This was caused by an attempt to fix a different callout testing related bug in Summer '20 (specifically, this one: https://success.salesforce.com/issues_view?id=a1p3A000000ATF1QAO) that clearly didn't work as we had intended. That fix is being rolled back in Summer '20 "patch 7".

The patch release schedule can vary on multiple factors, but for most pods this should be live this week. You can check the current patch level of your pod from the sidebar of https://success.salesforce.com/issues_releases_view?release=226007000

Sorry for the hassle. We're looking at what we can do for a revised fix to https://success.salesforce.com/issues_view?id=a1p3A000000ATF1QAO, but for the moment reverting the changes was the best option to unblock everybody.


We were able to fix breaking tests that occurred only during our full regression deployments by encapsulating the class that performed the http callout with System.Test.startTest() and System.Test.stopTest() actions.

We were performing http mock callouts as the very first action in @testSetup methods, so "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out" should not have occurred.

When our builds do deployments, we execute a full regression test. The tests were only breaking during a full regression test and only when deploying against sandboxes with the Summer '20 preview. The deployment package with unmodified tests was able to validate successfully against our Spring '20 production org.