mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged BRANCHES/V3.4 to HEAD:
23881: Hopefully avoid failures when run from a test suite, in the case of the previous test still having actions finishing up when we start git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23885 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.web.scripts.action;
|
package org.alfresco.repo.web.scripts.action;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
@@ -74,6 +76,32 @@ public class RunningActionRestApiTest extends BaseWebScriptTest
|
|||||||
private Repository repositoryHelper;
|
private Repository repositoryHelper;
|
||||||
private NodeRef dataDictionary;
|
private NodeRef dataDictionary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When we're run from a suite, check the previous
|
||||||
|
* test's work has finished before we run. If other
|
||||||
|
* things end up on the work queue with us, we'll
|
||||||
|
* get confused...
|
||||||
|
*/
|
||||||
|
public void testEnsureAllQuiet() throws Exception
|
||||||
|
{
|
||||||
|
// Wait up to 2 seconds
|
||||||
|
for(int i=0; i<200; i++)
|
||||||
|
{
|
||||||
|
List<ExecutionSummary> actions = actionTrackingService.getAllExecutingActions();
|
||||||
|
if(actions.size() == 0)
|
||||||
|
{
|
||||||
|
// Good, nothing running
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Wait for the previous test's stuff to finish
|
||||||
|
System.out.println("Waiting on " + actions.size() + " actions to finish, top is " + actions.get(0));
|
||||||
|
Thread.sleep(10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void testRunningActionsGet() throws Exception
|
public void testRunningActionsGet() throws Exception
|
||||||
{
|
{
|
||||||
Response response;
|
Response response;
|
||||||
|
Reference in New Issue
Block a user