in src/machines/parallel_no_concurrency.ts [15:37]
function createSlowSync(_scope: Construct, i: string) {
let testFail = new sfn.Fail(_scope, `testFail${i}`);
let successRun = new sfn.Succeed(_scope, `successParallel${i}`);
let successAlreadyRunning = new sfn.Succeed(_scope, `successAlreadyRunning${i}`);
return new RetryableLambdaInvoke(
_scope, `startSlowQuery${i}`, {
lambdaFunction: lambdaFunction,
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
payload: sfn.TaskInput.fromObject({
'taskToken': sfn.JsonPath.taskToken,
'executionArn.$': '$$.Execution.Id',
'sqlStatement': 'select public.f_slow(getdate()::varchar(50), 59)', //Should run for 1 minutes
'action': 'executeSingletonStatement',
}),
heartbeat: Duration.seconds(300),
resultPath: '$.executionDetails',
},
).addCatch(successAlreadyRunning, { errors: ['ConcurrentExecution'] }, // ConcurrentExecutions are expected
).addCatch(testFail, { errors: ['States.Timeout'] }, // We don't expect timeout on RS cluster
).addCatch(testFail, { errors: ['States.ALL'] }, // We don't expect any other failure
).next(successRun);
}