我正在运行一个自由式詹金斯作业,它在 Windows 从属机器上执行黄瓜测试用例。实际执行在 17:23 分钟内完成,但詹金斯作业总共需要 42 分钟才能完成。
是什么原因导致了这种延迟?
用于执行的命令mvn clean test
[ERROR] Tests run: 153, Failures: 14, Errors: 14, Skipped: 114
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] **Total time: 17:23 min**
[INFO] Finished at: 2019-10-11T17:05:23+01:00
[INFO] Final Memory: 10M/25M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test (default-test) on project com.lloyds.IPP: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Jenkins\workspace\IPP-BDD-Sanity-Pack\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Execute shell' marked build as failure
答案1
在队列中等待或未在执行器槽中运行的时间(即在node
或agent
块之外运行的步骤)不应计入总执行时间。
答案2
你从哪里得到这 42 分钟?
您应该在 Jenkins 构建日志的“状态”下看到如下部分:
本次运行花费:
- 等待9分33秒;
- 构建时长为 9 分 13 秒;
- 从计划到完成总共需要 18 分钟。
此外,该时间仅适用于 Maven 构建步骤。清理步骤有单独的时间。Jenkins SCM 步骤、构建前和构建后步骤也是如此;它们加到总数中。
我们有一项工作,需要 20 分钟来下载 repo,而仅需几分钟来执行步骤。