diff --git a/modules/nextflow/src/main/groovy/nextflow/processor/TaskArrayRun.groovy b/modules/nextflow/src/main/groovy/nextflow/processor/TaskArrayRun.groovy index b99875c895..c68eeea6d0 100644 --- a/modules/nextflow/src/main/groovy/nextflow/processor/TaskArrayRun.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/processor/TaskArrayRun.groovy @@ -58,4 +58,9 @@ class TaskArrayRun extends TaskRun { return true } + @Override + List getOutputFilesNames() { + return Collections.emptyList() + } + } diff --git a/modules/nextflow/src/test/groovy/nextflow/processor/TaskArrayRunTest.groovy b/modules/nextflow/src/test/groovy/nextflow/processor/TaskArrayRunTest.groovy index 3baa7b6213..daec2e4720 100644 --- a/modules/nextflow/src/test/groovy/nextflow/processor/TaskArrayRunTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/processor/TaskArrayRunTest.groovy @@ -20,6 +20,7 @@ import nextflow.Session import nextflow.container.resolver.ContainerInfo import nextflow.executor.Executor import nextflow.executor.TaskArrayExecutor +import nextflow.script.ProcessConfigV2 import spock.lang.Specification /** * @@ -52,4 +53,19 @@ class TaskArrayRunTest extends Specification { task.isArray() } + def 'should not stage output files because it is only a child task launcher' () { + given: 'a typed process' + def config = Mock(ProcessConfigV2) + def processor = Mock(TaskProcessor) { getConfig() >> config } + and: 'an array task whose context has no input variables bound, like the real array parent' + def task = new TaskArrayRun(processor: processor, context: Mock(TaskContext)) + + when: + def names = task.getOutputFilesNames() + + then: 'no output files are returned and the typed output declarations are never evaluated' + names == [] + 0 * config.getOutputs() + } + }