Apex Deployment and Queueable Jobs: Can In-Flight Async Work Block or Fail a Production Deploy?
0 reputation · 14 Sept 2021, 11:37 UTC
Scenario
We deploy Apex changes to a production org (API v59.0 assumed) that runs Queueable and future jobs around the clock. The Deployment Status page separates Component Failures from Test Failures, but it is unclear how it reports interference from asynchronous jobs that are already queued or executing while the deployment's test run starts.
Uncertainty
The documented behaviors we rely on are that production deployments enforce at least 75% org-wide Apex coverage via test execution, and that the Deployment Status log records the failing component or test class. What is not clear is the boundary between the deployment pipeline and the async job queue: whether a Queueable holding a lock on records touched by deployment tests can surface as a test failure indistinguishable from a genuine logic regression, and whether queued jobs are paused, allowed to complete, or left to collide with the validation window.
Questions
- Does Salesforce serialize deployment-time test execution against in-flight Queueable/future jobs, or can they run concurrently and cause spurious Test Failures?
- When a deployment fails for this reason, does the Deployment Status log distinguish async-related lock/contention errors from ordinary assertion failures?
- Is there a supported way to verify, before deploying, that no conflicting async jobs are pending?