From 0471dff3967a2e99e6c11bde15f6eb433822cc37 Mon Sep 17 00:00:00 2001 From: HDash <16350928+HDash@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:58:51 +0000 Subject: [PATCH] Fix PBSPRO queue status fetch Signed-off-by: HDash <16350928+HDash@users.noreply.github.com> --- .../src/main/groovy/nextflow/executor/PbsProExecutor.groovy | 2 +- .../src/test/groovy/nextflow/executor/PbsProExecutorTest.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/executor/PbsProExecutor.groovy b/modules/nextflow/src/main/groovy/nextflow/executor/PbsProExecutor.groovy index bcb0cbfa84..4bfbf6920a 100644 --- a/modules/nextflow/src/main/groovy/nextflow/executor/PbsProExecutor.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/executor/PbsProExecutor.groovy @@ -104,7 +104,7 @@ class PbsProExecutor extends PbsExecutor { if( queue ) { cmd += queue } else { - cmd += '$( qstat -B | grep -E -v \'(^Server|^---)\' | awk -v ORS=\' \' \'{print \"@\"\$1}\' )' + cmd += '$( qstat -B | grep -E -v \'(^Server|^---)\' | awk -v ORS=\' \' \'{if (\$1 != \"\") print \"@\"\$1}\' )' } return ['bash','-c', "set -o pipefail; $cmd | { grep -E '(Job Id:|job_state =)' || true; }".toString()] } diff --git a/modules/nextflow/src/test/groovy/nextflow/executor/PbsProExecutorTest.groovy b/modules/nextflow/src/test/groovy/nextflow/executor/PbsProExecutorTest.groovy index b9b4ec164b..4de6bd3e28 100644 --- a/modules/nextflow/src/test/groovy/nextflow/executor/PbsProExecutorTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/executor/PbsProExecutorTest.groovy @@ -211,7 +211,7 @@ class PbsProExecutorTest extends Specification { def executor = [:] as PbsProExecutor expect: - executor.queueStatusCommand(null) == ['bash','-c', "set -o pipefail; qstat -f \$( qstat -B | grep -E -v '(^Server|^---)' | awk -v ORS=' ' '{print \"@\"\$1}' ) | { grep -E '(Job Id:|job_state =)' || true; }"] + executor.queueStatusCommand(null) == ['bash','-c', "set -o pipefail; qstat -f \$( qstat -B | grep -E -v '(^Server|^---)' | awk -v ORS=' ' '{if (\$1 != \"\") print \"@\"\$1}' ) | { grep -E '(Job Id:|job_state =)' || true; }"] executor.queueStatusCommand('xxx') == ['bash','-c', "set -o pipefail; qstat -f xxx | { grep -E '(Job Id:|job_state =)' || true; }"] executor.queueStatusCommand('xxx').each { assert it instanceof String } }