Loading
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

Revenue Cloud: Intermittent Apex CPU Time Limit Exception When Testing Quote Repricing via Pricing/Sales Transaction Framework

게시 일자: Sep 25, 2026
상세 설명

Customers using a custom Apex invocable class to invoke quote repricing through the Place Sales Transaction execution path may observe an intermittent System.LimitException: Apex CPU time limit exceeded error specifically during unit test execution of that method, while the identical method executed live (via Execute Anonymous or normal application flow) consistently completes within a few seconds.

Debug log analysis shows the majority of CPU time is consumed within the underlying pricing execution framework rather than in the custom extension logic for pricing. Log comparisons between live and test execution reveal that the pricing framework experiences cache misses in the test context that do not occur in live execution, adding several seconds of processing overhead.

Apex test execution runs in an isolated transaction context, cached data available during live execution (such as pricing/business rule caches) is not available, resulting in longer execution and higher CPU consumption. This behavior has been observed across multiple environments and does not correlate with a specific custom configuration or code change, making it appear intermittent.

솔루션

This has been confirmed as expected platform behavior tied to test-context cache isolation, not a code defect. As a workaround, avoid asserting on strict CPU time thresholds within unit tests that exercise the pricing/repricing execution path, since test-context timing will differ from live execution.

Where possible, reduce the volume/complexity of data used in the test scenario, And isolate the repricing call so it can be tested with smaller scope, to reduce the chance of intermittently exceeding the synchronous Apex CPU limit during test runs.

Note : Place Sales Transaction apex execution can not provide runtime guarantees with Config and Pricing preferences set to System/Force within the PST payload and ideal unit tests for the same can be performed with setting these preferences to Skip. 

Knowledge 기사 번호

005460598

 
로드 중
Salesforce Help | Article