运行Gradle测试时发生管道故障错误 [英] Broken pipe error when running Gradle test

查看:2144
本文介绍了运行Gradle测试时发生管道故障错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于在gradle中运行测试的问题。我知道在其他机器上,我的gradle配置工作,但不幸的是我不是。我们已经得到了junit测试和testNG,并且在尝试执行时产生堆栈跟踪,如下所示:

 无法编写标准输入到:Gradle Worker 1. 
java.io.IOException:管道正在关闭
在java.io.FileOutputStream.writeBytes(Native方法)$ b $在java.io.FileOutputStream.write (FileOutputStream.java:318)
在java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
在java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
在org.gradle.internal.concurrent.DefaultExecutorFactory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:66)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)$ b $在java.lang.Thread .run(Thread.java:722)

不同的编号会产生这个错误(Gradle Worker 2,Gradle Worker 3等)。有没有人遇到类似的问题?



我使用gradle 1.6。

编辑:我忘了说我正在使用gradle包装器



编辑:在更改为1.12版后,我收到错误消息:

引起:org.gradle.api.InvalidUserDataException:无法创建任务'(custome taks name)':任务定义中的未知参数:[mustRunAfter] 
11: 20:17.990 [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory.validateArgs(TaskFactory.java:147)
11:20:17.991 [错误] [org .gradle.BuildExceptionReporter]在org.gradle.api.internal.project.taskfactory.TaskFactory.checkTaskArgsAndCreateDefaultValues(TaskFactory.java:134)
11:20:17.991 [错误] [org.gradle.BuildExceptionReporter]在有机gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:72)

编辑:好吧我想我已经找到了导致这个问题的原因 - 它是防病毒软件 。当我禁用脚本时,脚本稍微向前移动,但以以下方式结束:

  org.gradle.messaging.remote.internal.ConnectException:无法连接到服务器[e42b57ea-ced6-4bb6-9369-3186ab4983d6端口:63631,地址:[/ 127.0.0.1,/ 0:0:0:0:0:0:0:1]]。尝试过的地址:[/127.0.0.1,/ 0:0:0:0:0:0:0:1]。 
在org.gradle.messaging.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:62)
在org.gradle.messaging.remote.internal.hub.MessageHubBackedClient.getConnection(MessageHubBackedClient。 java:35)
at org.gradle.process.internal.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:54)
at org.gradle.process.internal.child.ActionExecutionWorker.execute(ActionExecutionWorker。的java:35)
。在org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker.java:85)
。在org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker。的java:41)
。在org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:43)
。在org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker。 java:32)
在org.gradle.process.intern al.launcher.BootstrapClassLoaderWorker.call(BootstrapClassLoaderWorker.java:46)
处jarjar.org.gradle org.gradle.process.internal.launcher.BootstrapClassLoaderWorker.call(BootstrapClassLoaderWorker.java:32)
。 process.internal.launcher.GradleWorkerMain.run(GradleWorkerMain.java:32)
at jarjar.org.gradle.process.internal.launcher.GradleWorkerMain.main(GradleWorkerMain.java:37)
引起: java.net.ConnectException:连接被拒绝:connect

一些旧的gradle 1.1错误信息)。任何人都遇到这种问题?

解决方案

Whew,经过一整天与Gradle的斗争,我终于找到了导致问题的原因。这是犯罪的杀毒软件 - COMODO。卸载它并安装另一个之后,一切都开始正常工作。因此,所有Gradle用户 - 请小心使用COMODO,因为即使禁用了,也可能在使用Gradle 时导致问题。注意:)

I've got a problem regarding running tests in gradle. I know that in other machines my gradle config works but in mine unfortunately not. We have got junit test and testNG and both of them, when try to execute, produces stacktrace like this:

Could not write standard input into: Gradle Worker 1.
java.io.IOException: The pipe is being closed
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:318)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

Which continuously will produce this error with different number (Gradle Worker 2, Gradle Worker 3, etc). Has anybody ever faced similar problem?

I'm using gradle 1.6.

EDIT: I forgot to tell that I'm using gradle wrapper

EDIT: After changing to version 1.12 I'm receiving error:

Caused by: org.gradle.api.InvalidUserDataException: Could not create task '(custome taks name)': Unknown argument(s) in task definition: [mustRunAfter]
11:20:17.990 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.TaskFactory.validateArgs(TaskFactory.java:147)
11:20:17.991 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.TaskFactory.checkTaskArgsAndCreateDefaultValues(TaskFactory.java:134)
11:20:17.991 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:72)

EDIT: Ok I think I have found what cause this problem - it was Antivirus. When I disable it script moves a little bit forward but ended with:

org.gradle.messaging.remote.internal.ConnectException: Could not connect to server [e42b57ea-ced6-4bb6-9369-3186ab4983d6 port:63631, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]. Tried addresses: [/127.0.0.1, /0:0:0:0:0:0:0:1].
    at org.gradle.messaging.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:62)
    at org.gradle.messaging.remote.internal.hub.MessageHubBackedClient.getConnection(MessageHubBackedClient.java:35)
    at org.gradle.process.internal.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:54)
    at org.gradle.process.internal.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:35)
    at org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker.java:85)
    at org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker.java:41)
    at org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:43)
    at org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:32)
    at org.gradle.process.internal.launcher.BootstrapClassLoaderWorker.call(BootstrapClassLoaderWorker.java:46)
    at org.gradle.process.internal.launcher.BootstrapClassLoaderWorker.call(BootstrapClassLoaderWorker.java:32)
    at jarjar.org.gradle.process.internal.launcher.GradleWorkerMain.run(GradleWorkerMain.java:32)
    at jarjar.org.gradle.process.internal.launcher.GradleWorkerMain.main(GradleWorkerMain.java:37)
Caused by: java.net.ConnectException: Connection refused: connect

Searching with google on this error gives me nothing (only some old gradle 1.1 errors info). Anybody faced this kind of problem?

解决方案

Whew, after whole day struggling with gradle I think I've finally found what cause problems. Guilty of that was antivirus - COMODO. After uninstalling it and installing another one, everything started to working fine. So all Gradle Users - please be careful with COMODO because even disabled, it could cause problems when using Gradle . Be aware :)

这篇关于运行Gradle测试时发生管道故障错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆