diff --git a/modules/nextflow/src/test/groovy/nextflow/processor/TaskHandlerTest.groovy b/modules/nextflow/src/test/groovy/nextflow/processor/TaskHandlerTest.groovy index 6ec29faf44..d5014baaf4 100644 --- a/modules/nextflow/src/test/groovy/nextflow/processor/TaskHandlerTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/processor/TaskHandlerTest.groovy @@ -263,4 +263,18 @@ class TaskHandlerTest extends Specification { [:] | "job_1" [TOWER_WORKFLOW_ID: '1234'] | "tw-1234-job_1" } + + def 'should not kill task twice'() { + given: + def handler = Spy(TaskHandler) + when: + handler.kill() + then: + 1 * handler.killTask() >> {} + + when: + handler.kill() + then: + 0 * handler.killTask() + } }