Updated
My support offer has moved to the Senior Support Team. They did something with my sandbox and reported that it was a known problem, and at the same time run test cases for one class using the Apex Class interface (for example, https://xyz.salesforce.com/01pL00000000001 ).
I should not run test cases with:
- Apex Progress Checker User Interface
- Manually creating ApexTestQueueItem records
- Apex Classes - [Run All Tests]
I assume Eclipse is currently ok for individual test cases, as it is not asynchronous in nature.
I would like to tell you exactly what they did with my problematic sandboxes, but at the moment I'm not sure. We hope that a parallel question on the developerforce forum gives several answers - Using Apex Test Execution leads to an “organization lock” that doesn't get cleared
Interesting information from Twitter:
"... worked on this all day. I hope the fix will be next wk." - Rich Unger
"@rich_unger good to hear, thanks for the update, any short-term solution? If not, I will transfer my code to another organization until then" - Michael Gallagher. "Workaround @ mjgallag24 - don't use asynchronous testing" - Rich Unger
So, to answer my own question, "How can I remove these ApexTestQueueItems from the" Processing "state?
Answer: you cannot at present if you are experiencing a "known problem". The only option is to raise a support question and wait for Salesforce to clear it.
I tried the following anonymous vertex to clear the apex test cases from the processing queue:
List<ApexTestQueueItem> items = [Select Id,ApexClassId,Status,ExtendedStatus,ParentJobId from ApexTestQueueItem where Status != 'Completed']; for(ApexTestQueueItem atqi : items) { atqi.Status = 'ABORTED'; } update items;
This does not seem to have the desired result, as in the subsequent SOQL query for ApexTestQueueItem, the status column remains unchanged.
I searched for Apex in [Administration Setup> Monitoring> Apex Jobs], but not one of the entries where JobType = TestRequest appeared.
Then I tried to abort using an anonymous vertex:
System.abortJob('707L0000000FgZIIA0');
AsyncApexJob changed the status to "Canceled".