testng-team / testng-eclipse

Eclipse plug-in for TestNG
https://testng.org
194 stars 164 forks source link

Debugging fails/hangs in Eclipse Kepler and Luna on Windows #116

Closed msandiford closed 9 years ago

msandiford commented 10 years ago

I am having an issue where TestNG tests cannot be debugged in Eclipse. I have tried in both Kepler and Luna, and neither is working.

Java -version shows:

java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode)

For Luna, I am using "Luna Release (4.4.0)" with build id: 20140612-0600. For Kepler, I am using "Kepler Service Release 2" with build id: 20140224-0627.

TestNG support is at version 6.8.6.20141201_2240 in both Eclipses.

The symptoms I am seeing:

  1. When starting a debugging session with breakpoints Eclipse hangs in a completely unresponsive state, usually at the 57% mark as shown in the progress bar in the lower right corner of the window.
  2. When starting a debugging session without breakpoints set, I eventually get a message box with the title "Couldn't launch TestNG", with the message "Couldn't connect to the RemoteTestNG client. Make sure you don't have an older version of testng.jar on your class path. Reason: Timeout while trying to contact RemoteTestNG."

I've tried adding -Dtestng.eclipse.verbose=true to the test launch configuration. This produces a bunch of output in the console tab in case (2) above, which I've reproduced an excerpt below.

In addition, the Eclipse log window reports a couple of errors, both the same, which I've also reproduced below.

Any help would be really appreciated. I've googled extensively and followed various pieces of advice on creating new workspaces, removing all breakpoints and recreating, changing memory configuration. None of this has worked. It appears from the logs and error logs that there is a problem connecting to the remote agent after launching, but I can't work out why.

Console output

[RemoteTestNG] Invoked with -serport 58257 -d C:\SRC\workspace\SomeWorkspace\SomeProject\test-output C:\Users\username\AppData\Local\Temp\testng-eclipse-688191240\testng-customsuite.xml 
[BaseMessageSender] Waiting for Eclipse client on localhost:58257
[BaseMessageSender] Received a connection from Eclipse on localhost:58257
[BaseMessageSender] Connection established, starting reader thread
[BaseMessageSender] ReaderThread waiting for an admin message
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:189)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:154)
    at java.io.BufferedReader.readLine(BufferedReader.java:317)
    at java.io.BufferedReader.readLine(BufferedReader.java:382)
    at org.testng.remote.strprotocol.BaseMessageSender$ReaderThread.run(BaseMessageSender.java:223)
[SerializedMessageSender] Sending message [GenericMessage suiteCount:1 testCount:1]
java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1857)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1766)
    at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:246)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
    at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:105)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
[TestRunner] Running the tests in 'Default test' with parallel mode:false
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@47ca2a priority: 10
[TestClass] Creating TestClass for [ClassImpl class=test.Class1Test]
[TestClass] Adding method Class1Test.testHashCode()[pri:0, instance:null] on TestClass class test.Class1Test
[TestClass] Adding method Class1Test.testConstructor()[pri:0, instance:null] on TestClass class test.Class1Test
[TestClass] Adding method Class1Test.testToString()[pri:0, instance:null] on TestClass class test.Class1Test
[TestClass] Adding method Class1Test.testEquals()[pri:0, instance:null] on TestClass class test.Class1Test
[TestClass] Creating TestClass for [ClassImpl class=test.Class2Test]
[TestClass] Adding method Class2Test.testMethod1End()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod1Begin()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testConstructor()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod4()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod3()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod2Reversed()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod2Normal()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod3Fail()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod1Fail2()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod1Fail1()[pri:0, instance:null] on TestClass class test.Class2Test
[TestClass] Adding method Class2Test.testMethod5()[pri:0, instance:null] on TestClass class test.Class2Test
[XmlMethodSelector] Including method test.beforeMethod()
[TestClass] Creating TestClass for [ClassImpl class=test.Class3Test]
[TestClass] Adding method Class3Test.testHashCode()[pri:0, instance:null] on TestClass class test.Class3Test
[TestClass] Adding method Class3Test.testConstructor()[pri:0, instance:null] on TestClass class test.Class3Test
[TestClass] Adding method Class3Test.testToString()[pri:0, instance:null] on TestClass class test.Class3Test
[TestClass] Adding method Class3Test.testEquals()[pri:0, instance:null] on TestClass class test.Class3Test
[TestClass] Adding method Class3Test.testCompareTo()[pri:0, instance:null] on TestClass class test.Class3Test
[XmlMethodSelector] Including method test.testHashCode()
[XmlMethodSelector] Including method test.testConstructor()
[XmlMethodSelector] Including method test.testToString()
[XmlMethodSelector] Including method test.testEquals()
[XmlMethodSelector] Including method test.testCompareTo()
[XmlMethodSelector] Including method test.testMethod1End()
[XmlMethodSelector] Including method test.testMethod1Begin()
[XmlMethodSelector] Including method test.testMethod4()
[XmlMethodSelector] Including method test.testMethod3()
[XmlMethodSelector] Including method test.testMethod2Reversed()
[XmlMethodSelector] Including method test.testMethod2Normal()
[XmlMethodSelector] Including method test.testMethod3Fail()
[XmlMethodSelector] Including method test.testMethod1Fail2()
[XmlMethodSelector] Including method test.testMethod1Fail1()
[XmlMethodSelector] Including method test.testMethod5()
[TestNG] Running:
  C:\Users\username\AppData\Local\Temp\testng-eclipse-688191240\testng-customsuite.xml

[SerializedMessageSender] Sending message [SuiteMessage suite:Default suite starting methodCount:0]
java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1857)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1766)
    at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:246)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
    at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
    at org.testng.remote.RemoteTestNG$RemoteSuiteListener.onStart(RemoteTestNG.java:255)
    at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:197)
    at org.testng.SuiteRunner.run(SuiteRunner.java:238)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

There is more output from the console, but I haven't included it here.

Errors from log window

java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:125)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:183)
    at java.net.ServerSocket.implAccept(ServerSocket.java:522)
    at java.net.ServerSocket.accept(ServerSocket.java:490)
    at org.testng.remote.strprotocol.BaseMessageSender.initReceiver(BaseMessageSender.java:128)
    at org.testng.eclipse.ui.TestRunnerViewPart.startTestRunListening(TestRunnerViewPart.java:362)
    at org.testng.eclipse.TestNGPlugin.connectTestRunner(TestNGPlugin.java:213)
    at org.testng.eclipse.TestNGPlugin$2.run(TestNGPlugin.java:201)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)```
JnRouvignac commented 10 years ago

Hi,

I wonder if you test started at all? I have kind of the same problem where I work.

Check the output console in Eclipse to see if anything prevents your test from starting at all (ExceptionInInitializerError or equivalent).

msandiford commented 10 years ago

In case (2), eventually the tests actually run. I haven't included the full console output, as it is around 1700 lines - but further down the file from the output above, I get the below eventually, after the error dialog. In case (1) with breakpoints, Eclipse hangs.

I don't know if it's worth noting that JUnit tests run fine, and are debuggable. Applying advanced guesswork, It looks to be as if the server side of the debugging session closes the socket prematurely.

Console output in full is available here: https://gist.github.com/msandiford/c262989e2e66f07f4953

Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\Default suite\Default test.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\Default suite\Default test.xml
[SerializedMessageSender] Sending message [TestMessage suite:Default suite testName:Default test passed:20 failed:0]
java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1857)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1766)
    at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:246)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
    at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
    at org.testng.remote.strprotocol.RemoteTestListener.onFinish(RemoteTestListener.java:34)
    at org.testng.TestRunner.fireEvent(TestRunner.java:1241)
    at org.testng.TestRunner.afterRun(TestRunner.java:1032)
    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:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
PASSED: testConstructor
PASSED: testMethod1Fail1
PASSED: testMethod1Fail2
PASSED: testMethod2Normal
PASSED: testMethod1Begin
PASSED: testMethod1End
PASSED: testMethod2Reversed
PASSED: testMethod3
PASSED: testMethod3Fail
PASSED: testMethod4
PASSED: testMethod5
PASSED: testConstructor
PASSED: testEquals
PASSED: testHashCode
PASSED: testToString
PASSED: testCompareTo
PASSED: testConstructor
PASSED: testEquals
PASSED: testHashCode
PASSED: testToString

===============================================
    Default test
    Tests run: 20, Failures: 0, Skips: 0
===============================================

[SerializedMessageSender] Sending message [SuiteMessage suite:Default suite ending methodCount:31]
java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1857)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1766)
    at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:246)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
    at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
    at org.testng.remote.RemoteTestNG$RemoteSuiteListener.onFinish(RemoteTestNG.java:250)
    at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:200)
    at org.testng.SuiteRunner.run(SuiteRunner.java:243)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

===============================================
Default suite
Total tests run: 20, Failures: 0, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.EmailableReporter2@134b191: 0 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@1ecf5e7: 30 ms
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\toc.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\Default test.properties
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\index.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\main.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\groups.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-alphabetical.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\classes.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\reporter-output.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\methods-not-run.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\Default suite\testng.xml.html
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\old\index.html
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@ff8acd: 60 ms
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\junitreports\TEST-test.Class1Test.xml
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\junitreports\TEST-test.Class2Test.xml
Creating C:\SRC\workspace\SomeWorkspace\SomeProject\test-output\junitreports\TEST-test.Class3Test.xml
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@9b9e76: 10 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@3f97d7: 10 ms
ppoulard commented 9 years ago

Hi,

I had exactly the same issue ; I read many answer on StackOverflow, made many tries (see http://stackoverflow.com/questions/24964921/error-couldnt-contact-the-remotetestng-client) and nothing worked.

My solution : before running my test in debug mode, i open the debug view, and remove some breakpoints (such as some remaining on NullPointersExceptions, and Sockets) : it doesn't hang any longer !

eperret commented 9 years ago

I am getting a similar issue. Was this ever resolved?

eclipse.buildId=3.6.3.201501121239-SR1-e44 java.version=1.8.0_31 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.springsource.sts.ide -keyring /Users/[REDACTED]/.eclipse_keyring -showlocation Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.springsource.sts.ide -keyring /Users/[REDACTED]/.eclipse_keyring -showlocation

java.net.SocketTimeoutException: Accept timed out
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:404)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at org.testng.remote.strprotocol.BaseMessageSender.initReceiver(BaseMessageSender.java:128)
    at org.testng.eclipse.ui.TestRunnerViewPart.startTestRunListening(TestRunnerViewPart.java:362)
    at org.testng.eclipse.TestNGPlugin.connectTestRunner(TestNGPlugin.java:213)
    at org.testng.eclipse.TestNGPlugin$2.run(TestNGPlugin.java:201)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3983)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Wouter1 commented 9 years ago

I had a similar issue.

It seems that stale breakpoints in the debugger are the culprit. Try removing all the breakpoints (even if breakpoints are disabled the problem still occurs, yes even if both disabled entirely and piecewise).

Also, Eclipse Enterprise Edition seems more sensitive to this than the standard edition.

Wouter1 commented 9 years ago

I found another possible cause: a large number of threads quickly appearing and disappearing. So far I saw two situations that cause this:

  1. threads appearing from a threadpool
  2. threads appearing for garbage collection

Both can apparently run out of control and then Eclipse crashes when the debug panel tries to show all these threads.

phensley commented 9 years ago

@msandiford You may be seeing the same issue I'm seeing on Mac Yosemite. Patch #148 resolved it for me.

missedone commented 9 years ago

link to #155 as looks like both share the same root cause

missedone commented 9 years ago

hi guys, new testng eclipse plugin build 6.9.5.201508210528 was just out, could you update to this version and verify if this issue resolved, thanks

missedone commented 9 years ago

this issue should be fixed in PR #166, let's close it

cbeust commented 9 years ago

@missedone I just added you as a collaborator, you can now close issues yourself.

Thanks!

missedone commented 9 years ago

@cbeust, thanks:)

avinashatgit commented 8 years ago

I had a similar issue, tried many solutions above but did not work. Later I found that localhost in my etc/hosts file was pointing to my machine ip not to 127.0.0.1. Once I corrected that, issues was resolved.