I am using a workflow in which I am calling many activities which are then running workflows in async and then I am relying on activity retrial to let the workflow complete and then move on to the next activity. However for the workflow Junit test, the time taken for activity retrial where I start a workflow does not get skipped and I am forced to wait for seconds/minutes based on the actual retry configuration I have set up. This is not the case with other activities where I do not start a workflow.
Pseudocode for the same:
@ActivityMethod
public boolean activity(Request request, String workflowId) {
if (!workflowComplete(workflowId)) {
if (isWorkflowRunning(workflowId)) {
throw new RETRY_ACTIVITY_ERROR;
}
startWorkflow(request, workflowId);
throw new RETRY_ACTIVITY_ERROR;
}
return true;
}