Last active
September 30, 2020 17:16
-
-
Save cemerson/8aad683ee55fce47854c8620a301d812 to your computer and use it in GitHub Desktop.
SFDC: Clear running or stuck Apex Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use if/when you have tests that are stuck in the middle or running | |
(sometimes this can happen and you can't actually see/confirm it - | |
in which case running this will clear everything out) */ | |
List<ApexTestQueueItem> atqi_list = [select id, status from apextestqueueitem where status NOT IN ('Completed', 'Failed', 'Aborted')]; | |
for(ApexTestQueueItem atqi : atqi_list) | |
atqi.status = 'Aborted'; | |
update atqi_list; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment