5
votes

I am getting below error while executing the code using gradle for a particular test suite.Not understanding the reason . Any help appreciated.

org.gradle.internal.remote.internal.MessageIOException: Could not write '/127.0.0.1:53644'. at org.gradle.internal.remote.internal.inet.SocketConnection.flush(SocketConnection.java:121) at org.gradle.internal.remote.internal.hub.MessageHub$ConnectionDispatch.run(MessageHub.java:300) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host at sun.nio.ch.SocketDispatcher.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) at sun.nio.ch.IOUtil.write(IOUtil.java:51) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeWithNonBlockingRetry(SocketConnection.java:259) at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeBufferToChannel(SocketConnection.java:247) at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:241) at org.gradle.internal.remote.internal.inet.SocketConnection.flush(SocketConnection.java:119)

1
Had the same error while running tests. It happens this comes from a Java Exception raised during the tests that certainly ends up into System.exit(). After debugging and fixing this exception, everything was back to fine normal running.frva

1 Answers

0
votes

I got this same error using gradle in a Dropwizard project. The problem was that the unit tests were using their own version of the config.yml file, and the "real" version of config (and the app code) had been changed so that it no longer matched the test config.yml. When I fixed the test config.yml, the problem went away. I also saw this error occur (again running the test task in a gradle build for a Dropwizard project) when I had local docker containers running. Shutting down the docker containers fixed this issue (don't know why but this happened at least two times).