我的一个测试任务失败,在任何日志中都没有任何明显的错误消息:
:midonet-cluster:test FAILED
失败:构建因异常而失败。
*出了什么问题: 任务执行失败':midonet-cluster:test'。
处理' Gradle Test Executor 12'完成非零退出值29
这是stacktrace:
org.gradle.api.tasks.TaskExecutionException:任务':midonet-cluster:test'执行失败。 [一千九百九十八分之一十七] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:98) 在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:68) 在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) 在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46) 在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) 在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) 在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker $ 1.execute(DefaultTaskGraphExecuter.java:236) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker $ 1.execute(DefaultTaskGraphExecuter.java:228) 在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58) 在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32) 在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113) 在org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 在org.gradle.execution.DefaultBuildExecuter.access $ 000(DefaultBuildExecuter.java:23) 在org.gradle.execution.DefaultBuildExecuter $ 1.proceed(DefaultBuildExecuter.java:43) 在org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) 在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) 在org.gradle.initialization.DefaultGradleLauncher $ RunTasksAction.execute(DefaultGradleLauncher.java:230) 在org.gradle.initialization.DefaultGradleLauncher $ RunTasksAction.execute(DefaultGradleLauncher.java:227) 在org.gradle.internal.Transformers $ 4.transform(Transformers.java:169) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) 在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) 在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:161) 在org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112) 在org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:95) 在org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66) 在org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) 在org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) 在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) 在org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) 在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:49) 在org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:31) 在org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51) 在org.gradle.internal.Actions $ RunnableActionAdapter.execute(Actions.java:173) 在org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:281) 在org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:254) 在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33) 在org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) 在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 在org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:247) 在org.gradle.launcher.cli.CommandLineActionFactory $ WithLogging.execute(CommandLineActionFactory.java:182) 在org.gradle.launcher.Main.doAction(Main.java:33) 在org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 在org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60) 在org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37) 在org.gradle.launcher.GradleMain.main(GradleMain.java:23) 在org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 在org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 在org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
引起:org.gradle.process.internal.ExecException:进程' Gradle Test Executor 11'完成非零退出值29 at org.gradle.process.internal.DefaultExecHandle $ ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369) 在org.gradle.process.internal.worker.DefaultWorkerProcess.waitForStop(DefaultWorkerProcess.java:190) 在org.gradle.process.internal.worker.DefaultWorkerProcessBuilder $ MemoryRequestingWorkerProcess.waitForStop(DefaultWorkerProcessBuilder.java:228) 在org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.stop(ForkingTestClassProcessor.java:122) at org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor.endBatch(RestartEveryNTestClassProcessor.java:63) at org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor.stop(RestartEveryNTestClassProcessor.java:57) 在org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) 在org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 在org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:29) 在org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132) at org.gradle.internal.dispatch.AsyncDispatch.access $ 000(AsyncDispatch.java:33) 在org.gradle.internal.dispatch.AsyncDispatch $ 1.run(AsyncDispatch.java:72) at org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) 在org.gradle.internal.concurrent.StoppableExecutorImpl $ 1.run(StoppableExecutorImpl.java:46)
没有失败的测试。
这似乎是一些资源问题,因为当我减少测试次数(通过从测试任务中排除包)时问题就消失了。排除哪些测试并不重要。
如果禁用了gradle守护程序,问题仍然存在。
Gradel版本是3.5.1但问题仍然存在于4.5.1。
在调试模式下运行任务不会显示任何新内容。我们可以检查失败的流程是否已移至" STARTED"状态,然后到" FAILED"状态。
这种情况总是发生在具有80GB RAM的ubuntu16.04机器上,有时在我的MAC上有16GB内存。
任何帮助如何解决或调试这将非常感谢!
非常感谢提前。
答案 0 :(得分:3)
原来是由主代码调用的System.exit(),因为有些测试没有关闭后端服务。我相信gradle可能会更好地处理这个问题:)