New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix debug launch thread hang using modified denyska patch. #148
Conversation
Wow, this has to be the most elaborately described problem and fix I've ever seen, this is just plain awesome. Thanks a lot, Patrick! |
Fix debug launch thread hang using modified denyska patch.
Awesome I had same issue |
@cbeust 👍 Thanks for the fast merge! |
I am still seeing this issue running Luna Service Release 2 (4.4.2) Build id: 20150219-0600 with the testng plugin version 6.9.5.201506120235 Is someone able to confirm has this fix been included in this version of the plugin? Just FYI, running the same test using "Run" works perfectly, it is only when running as "Debug" that I get the 57% hang and error modal. I just checked out the latest from master and still see the same issue. Debug output is:
Thanks |
Yes, the update site contains the fix. Are you seeing this from a fresh Cédric On Fri, Jun 12, 2015 at 2:21 PM, Stephen Hartley notifications@github.com
|
@cbeust Tried out in a clean workspace and still see the same problem. Interestingly it is only happening when I debug and have a breakpoint in the JDK source, for example in Any thoughts as to why this might be? I don't know if this is relevant but the maven dependency for testng is version 6.9.4 but the eclipse plugin is at version 6.9.5, does this have any negative impact? JDK version is 1.8.0_45. The same test debugs as expected when using JUnit, even with breakpoints in the JDK source... Thanks! Steve |
Yes. this usually happens because of break points. I'm guessing your break Cédric On Sat, Jun 13, 2015 at 4:23 AM, Stephen Hartley notifications@github.com
|
Yes, the break point does trigger, here's the stack. I can see that
|
Yup, pretty much explains everything. The Eclipse plug-in launches Cédric On Sat, Jun 13, 2015 at 12:04 PM, Stephen Hartley notifications@github.com
|
Thanks for the explanation Cédric. Does this mean this is a bug in testng-eclipse? How can I help to get it fixed - should I raise a new issue? I cloned testng and built the latest version as testng-6.9.5-SNAPSHOT.jar and see the same problem there too. Thanks again Steve |
@stephenhartley |
I ran into the 57% hang bug with the latest versions of Eclipse and testng-eclipse, and have resolved it by applying a slightly-modified version of patch #36 mentioned in issue #55.
Debug setup:
do..while
loop inTestRunnerViewPart.startTestRunListening
with afor 0..3
loop.Test case:
Launch as Debug -> TestNG, here is the sequence of events:
55677
is selected by testng-eclipse plugin to listen on.-serport 55677
argument.55678
to talk to Eclipse debugger.55678
. JVM is paused, waiting for Eclipse to signal the JVM to start executing.55677
, but DemoTest JVM is paused, so it will never attempt to connect.Dtrace transcripts
RemoteTestNG process paused, waiting for Eclipse debugger to signal it to begin executing (stack trace of process):
TCP connect attempts during the test:
Fix
The fix is to apply this modified version of @denyska's patch. It resolves the deadlock, since it allows the
startTestRunListening()
method to return, which allows the RemoteTestNG process to begin executing and connect to testng-eclipse listener. Since running this version I've had zero problems with the 57% hang.