testNG java.net.SocketException: Software caused connection abort: socket write error

执行用例报错,提示 java.net.SocketException: Software caused connection abort: socket write error

java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at java.io.BufferedWriter.flush(BufferedWriter.java:254)
at org.testng.remote.strprotocol.JsonMessageSender.sendMessage(JsonMessageSender.java:41)
at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:42)
at org.testng.remote.strprotocol.RemoteTestListener1.onFinish(RemoteTestListener1.java:34)
at org.testng.TestRunner.fireEvent(TestRunner.java:1246)
at org.testng.TestRunner.afterRun(TestRunner.java:1039)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)

 

解决方法:

碰到这个问题不是代码问题,因为通过mvn test去执行是不会报错的,那么分析是testNG插件问题,google出来大致也是因为插件版本问题,需要使用低版本的testNG 插件,

统一插件版本和pom.xml中的版本,如我个人统一使用6.9.5版本解决了该问题

 

参考资料:

https://github.com/cbeust/testng-eclipse/issues/91

https://github.com/cbeust/testng-eclipse/issues/329

虽千万人,吾往矣!
上一篇:优化testng报告


下一篇:修改(同步)linux时间