• Matthew Holliday 54
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I'm trying to complete the "
Get Hands-on Using Platform Events from Batch Apex Classes" challenge for Summer 19 Maintenance Exam. When I hit "check challenge" I get the following error message:

"When executed, the BatchLeadConvertTest test class has test failures. All tests should pass."

However, when I run "Batch LeadConvertTest" in the trailhead playground org the test DOES pass. Here is my code for the trigger:
 
trigger BatchApexErrorTrigger on BatchApexErrorEvent (after insert) {
    List<BatchLeadConvertErrors__c> leadConvertErrors = new List<BatchLeadConvertErrors__c>();
    for(BatchApexErrorEvent batchApexErrorEvent : Trigger.new){
        BatchLeadConvertErrors__c errors = new BatchLeadConvertErrors__c();
        errors.Records__c = batchApexErrorEvent.JobScope;
        errors.StackTrace__c = batchApexErrorEvent.StackTrace;
        leadConvertErrors.add(errors);
    }
}

I have also verified the following: 
-The managed package for the challenge was installed for all users. 
-The BatchLeadConvert class implements Database.RaisesPlatformEvents.
-I'm checking the same sandbox org that the code is in. 

Any insight into why the Check Challenge error message says the test is failing when it clearly succeeds in the sandbox would be helpful!