Skip to content

Commit 0f3694e

Browse files
committed
fix(matrix): honor timeout on module-type steps
Per-step `timeout` was silently ignored for steps using `module: <name>` (e.g. `module: slurm`). The action branch of `run_step` dispatches modules directly, bypassing `run_step_shell` — the only path that reads `timeout` and wraps execution in Jenkins' `timeout()`. Apply the fix centrally so all module types (`slurm`, `dynamicAction`, ...) honor `timeout` uniformly: the action branch now reads the same `getConfigVal(..., ['timeout'], ...)` value used by shell steps and wraps the module dispatch in `timeout(time: X, unit: 'MINUTES')`. `onfail`/`always` plumbing still does not exist for module steps, so on timeout the `FlowInterruptedException` propagates and aborts the stage. That can be added in a follow-up if needed. Signed-off-by: Daniel Pressler <danielpr@nvidia.com>
1 parent dd4da82 commit 0f3694e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/com/mellanox/cicd/Matrix.groovy

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,15 @@ def run_step(image, config, title, oneStep, axis, runtime=null) {
615615
}
616616

617617
config.logger.trace(4, "Running step action module=" + oneStep.module + " args=" + oneStep.args + " run=" + oneStep.run)
618-
int rc = this."${oneStep.module}"(this, oneStep, config)
618+
def timeout_minutes = getConfigVal(config, ['timeout'], null, true, oneStep, true)
619+
def rc
620+
if (timeout_minutes) {
621+
timeout(time: timeout_minutes, unit: 'MINUTES') {
622+
rc = this."${oneStep.module}"(this, oneStep, config)
623+
}
624+
} else {
625+
rc = this."${oneStep.module}"(this, oneStep, config)
626+
}
619627
if (rc != 0) {
620628
reportFail(oneStep.name, "exit with error code=${rc}")
621629
}

0 commit comments

Comments
 (0)