Closed msandiford closed 9 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).
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
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 !
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)
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.
I found another possible cause: a large number of threads quickly appearing and disappearing. So far I saw two situations that cause this:
Both can apparently run out of control and then Eclipse crashes when the debug panel tries to show all these threads.
@msandiford You may be seeing the same issue I'm seeing on Mac Yosemite. Patch #148 resolved it for me.
link to #155 as looks like both share the same root cause
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
this issue should be fixed in PR #166, let's close it
@missedone I just added you as a collaborator, you can now close issues yourself.
Thanks!
@cbeust, thanks:)
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.
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:
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:
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
There is more output from the console, but I haven't included it here.
Errors from log window