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
Eager-2-LearnEager-2-Learn 

Code coverage differences and failures succes between Summer '18 and Winter '19

I have an issue that is happening in Summer '18 but not in Winter '19 sandboxes and the test class and code base is the same in both orgs.
 
I have a process that triggers from a user record being deactivated.  It performs a callout and performs the deactivation in all connected sandboxes which works like a charm.
 
My test class creates a user record and uses a mock class to get the proper code coverage.  It works like a charm in the Winter '19 sandbox; however, it still works in the Summer '18 sandbox but the code coverage drops from 100 to 82.  Further review I see the following message in the logs on the Summer or but not in the Winter org.
 
System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out.
 
I saw a 2016 post stating similar issue and the work around was to read the user record from the database instead of created one within your test class and it was also marked as fixed.
 
One thing to note is I do not create the test user inside the Test.startTest() and Test.stopTest() which I believe the correct way.
 
Has anyone experienced this issue and do you have better solution than to break Salesforce's own rule not to read existing database data and create your own with in the test class.
 
Thank you for your help.