Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit 0403a24

Browse files
jdrbcTREX1-JR
andauthored
fix(apex-test): additional parallel run error (#1436)
retry on 'Too many concurrent Apex compilations during resource mitigation' & 'LIMIT_EXCEEDED' Co-authored-by: John Rogers <[email protected]>
1 parent db5b22a commit 0403a24

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

decision records/validate/001-automated-apex-testing-retry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A recently surfaced issue (#836), have uncovered coverage calculation becoming e
2020

2121
## Decision
2222

23-
sfpowerscripts will collect all the test classes that failed in an asynchronous run due to 'UNABLE_TO_LOCK_ROW', 'Your request exceeded the time limit for processing' or an 'Internal Salesforce Error' and trigger these tests in synchronous mode.
23+
sfpowerscripts will collect all the test classes that failed in an asynchronous run due to 'UNABLE_TO_LOCK_ROW', 'Your request exceeded the time limit for processing', 'LIMIT_EXCEEDED', 'Too many concurrent Apex compilations during resource mitigation', or an 'Internal Salesforce Error' and trigger these tests in synchronous mode.
2424

2525
sfpowerscripts will also figure out any tests classes that were not able to contribute to code coverage and execute them synchronously. As the current test api has limitation on how tests could be triggered synchronously (only one test class is allowed), sfpowerscripts will change the mode of the org to 'Disable Parallel Testing' by changing the apex setting as mentioned [ here](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_apexsettings.htm). sfpowerscripts will utilize jsforce update (http://jsforce.github.io/jsforce/doc/Metadata.html) to update this setting on the fly.
2626
Once the setting is successfully toggled, it will proceed to execute these tests using asynchronous payload, which is equivalent to triggering test classes synchronously. The coverage results are then converged and new coverage value is calculated

packages/core/src/apextest/TriggerApexTests.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ export default class TriggerApexTests {
353353
if (
354354
test.message.includes(`Your request exceeded the time limit for processing`) ||
355355
test.message.includes(`UNABLE_TO_LOCK_ROW`) ||
356-
test.message.includes(`Internal Salesforce Error`)
356+
test.message.includes(`Internal Salesforce Error`) ||
357+
test.message.includes(`LIMIT_EXCEEDED`) ||
358+
test.message.includes(`Too many concurrent Apex compilations during resource mitigation`)
357359
) {
358360
if (!testToBeTriggered.includes(test.apexClass.fullName)) {
359361
parallelFailedTestClasses.push(test.apexClass.fullName);

0 commit comments

Comments
 (0)