简体   繁体   English

詹金斯不会杀死node.exe吗?

[英]Jenkins won't kill node.exe?

I've got a Jenkins job set up to run a node.js server in the background, perform some tests on it (through a batch script, using Nightwatch), and then kill off the node server using the TaskKill batch command. 我已经设置了一个Jenkins作业,以便在后台运行node.js服务器,对其进行一些测试(通过使用Nightwatch的批处理脚本),然后使用TaskKill批处理命令终止该节点服务器。 Here's the command line script I have for the build: 这是我用于构建的命令行脚本:

START /B node ../app.js
runtests.bat
taskkill /F /IM node.exe

The build runs and passes, but it never seems to kill node. 构建会运行并通过,但它似乎永远不会杀死节点。 At the end of the console output I get: 在控制台输出的最后,我得到:

Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information

And I can see the node.exe process still running in my Task Manager. 而且我可以看到node.exe进程仍在我的任务管理器中运行。

If I run the same commands in my own command prompt it works fine, and kills node. 如果我在自己的命令提示符中运行相同的命令,它将正常工作并杀死节点。 It's just that Jenkins doesn't seem to execute that last command at all. 只是詹金斯似乎根本没有执行最后一条命令。

Any ideas? 有任何想法吗? Am I maybe taking the wrong approach altogether? 我是否可能完全采用了错误的方法?

Well I managed to get it working by installing the Hudson Post Build Task plugin, and just killing node in a post-build command. 好吧,我设法通过安装Hudson Post Build Task插件使其工作,并只是在post-build命令中杀死了节点。 Still not sure why it wasn't working before though. 仍然不确定为什么它以前没有起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM