SALESFORCE-PD1 Process Automation And Logic Practice Question
A developer implemented a Queueable Apex class that performs heavy processing. During testing, the developer wants to verify whether the asynchronous job has finished executing before running dependent unit test assertions. What should the developer use?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Test.startTest() and Test.stopTest() block around the enqueueJob call
Developers use Test.startTest() and Test.stopTest() in unit tests to force all asynchronous jobs enqueued within the block to execute synchronously before proceeding.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Test.startTest() and Test.stopTest() block around the enqueueJob call
Why this is correct
Test.stopTest() forces asynchronous code to execute synchronously within the test context.
- ✗
AsyncApexJob query inside a loop with Thread.sleep()
Why it's wrong here
Thread.sleep() does not exist in Apex, and polling AsyncApexJob inside limits is inefficient and risks governor limit violations.
- ✗
A custom countdown latch pattern using platform cache
Why it's wrong here
Platform cache or custom polling adds unnecessary complexity when the test framework natively handles asynchronous execution via Test.stopTest().
- ✗
System.assertAsyncExecution() method
Why it's wrong here
System.assertAsyncExecution() is not a valid method in Apex.
About these practice questions
This SALESFORCE-PD1 question is part of Courseiva's 493-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.