超时后中止Jenkins管道(工作流)构建

zaq34kh6  于 2022-12-17  发布在  Jenkins
关注(0)|答案(1)|浏览(176)

每当构建在某处卡住或失败时,超时就会启动,但构建不会中止,并且它会永远卡住运行,直到您取消构建,进入控制台并按链接Click here to forcibly terminate running steps
下面是一个示例代码,我正在尝试,但没有工作:

stage concurrency: 1, name: 'Build'
def buildSteps = [:]
    buildSteps['Server'] = {
        timeout(1) {
            node('build') {
                timestamps {
                     bat "waitfor nothing /t 120 >nul"
            }
        }
    }   
}

parallel buildSteps

这是日志

[Pipeline] stage (Build)
Entering stage Build
Proceeding
[Pipeline] parallel
[Pipeline] [Server] { (Branch: Server)
[Pipeline] [Server] timeout
[Pipeline] [Server] {
[Pipeline] [Server] node
[Server] Running on CI106 in C:\Jws\workspace\jftimeout
[Pipeline] [Server] {
[Pipeline] [Server] timestamps
[Pipeline] [Server] {
[Pipeline] [Server] bat
14:42:52 [Server] [jftimeout] Running batch script
14:42:53 [Server] 
14:42:53 [Server] C:\Jws\workspace\jftimeout>waitfor nothing /t 120  1>nul 
14:43:52 [Server] Sending interrupt signal to process
Aborted by user
14:49:29 [Server] Sending interrupt signal to process
Click here to forcibly terminate running steps
Terminating bat
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
Failed in branch Server
[Pipeline] // parallel
[Pipeline] End of Pipeline

在14:43:52,超时发送停止信号,但没有任何React。
Aborted by user时,我手动取消了构建

bqujaahr

bqujaahr1#

安装构建超时插件https://wiki.jenkins-ci.org/display/JENKINS/Build-timeout+Plugin转到管理Jenkins〉配置系统〉构建超时插件〉构建步骤操作〉选中启用构建步骤操作
我启用插件后,构建停止时,超时已达到.

相关问题