how to debug TCK tests?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to debug TCK tests?

Cesar Hernandez
Hi,

I created the following document to track my TCK related work.
https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing

As you can see I executed today the tests from the  "appclient" category.

One of the failing test is:
com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11

The way I'm executing just that tests is with the following command:
./runtests --web tomee-plume -c -sql active -da
com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11

Notice that I'm adding:
 -sql to enable (according to with runtests script code [1]) required
databases to be created.
-da to enable TCK appclient debug options (port 5003)

Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
debug configuration for Listen to Remote JVM at port: 5003

Unfortunately, I'm not able to make this to work and degub the failing test.


[1] https://github.com/apache/tomee-tck/blob/master/runtests#L30
[2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38
[3] https://jenkins.eclipse.org/jakartaee-tck/

--
Atentamente:
César Hernández Mendoza.
Reply | Threaded
Open this post in threaded view
|

Re: how to debug TCK tests?

David Jencks-3
From the distant past, I recall it being tricky to debug the app client tests. Can you tell what is happening?
Is the app client container starting?
Does it suspend for the debugger attachment? If not, it probably runs to completion before you can attach-I definitely remember this happening to me!
Does it suspend but not allow attachment?
Is the test harness or appclient test harness (I don’t recall if these are separate) suspended waiting for attachment?

Hope this helps!
David Jencks

Sent from my iPhone

> On Jan 28, 2019, at 2:31 PM, César Hernández Mendoza <[hidden email]> wrote:
>
> Hi,
>
> I created the following document to track my TCK related work.
> https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing
>
> As you can see I executed today the tests from the  "appclient" category.
>
> One of the failing test is:
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> The way I'm executing just that tests is with the following command:
> ./runtests --web tomee-plume -c -sql active -da
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> Notice that I'm adding:
> -sql to enable (according to with runtests script code [1]) required
> databases to be created.
> -da to enable TCK appclient debug options (port 5003)
>
> Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
> debug configuration for Listen to Remote JVM at port: 5003
>
> Unfortunately, I'm not able to make this to work and degub the failing test.
>
>
> [1] https://github.com/apache/tomee-tck/blob/master/runtests#L30
> [2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38
> [3] https://jenkins.eclipse.org/jakartaee-tck/
>
> --
> Atentamente:
> César Hernández Mendoza.
Reply | Threaded
Open this post in threaded view
|

Re: how to debug TCK tests?

Cesar Hernandez
Hi David,
Thanks for the reply!

Responding in line:

Is the app client container starting?
Yes,

Does it suspend for the debugger attachment? If not, it probably runs to completion before you can attach-I definitely remember this happening to me!
I don't suspend at all, the following command just runs and then crashess (you can check the attached javatest.log):
./runtests --web tomee-plume -c -sql active -da com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11

Because it's doesn't suspend, I configure in the IDE [Listen to Remote JVM at port: 5003] instead of [Attach to Remote JVM at port: 5003]. 
But that didn't work either.

Is the test harness or appclient test harness (I don’t recall if these are separate) suspended waiting for attachment?
Base on the naming convention [1] from the test, I think it's an appclient tests harness. How can I verify this?



El lun., 28 ene. 2019 a las 17:23, David Jencks (<[hidden email]>) escribió:
From the distant past, I recall it being tricky to debug the app client tests. Can you tell what is happening?
Is the app client container starting?
Does it suspend for the debugger attachment? If not, it probably runs to completion before you can attach-I definitely remember this happening to me!
Does it suspend but not allow attachment?
Is the test harness or appclient test harness (I don’t recall if these are separate) suspended waiting for attachment?

Hope this helps!
David Jencks

Sent from my iPhone

> On Jan 28, 2019, at 2:31 PM, César Hernández Mendoza <[hidden email]> wrote:
>
> Hi,
>
> I created the following document to track my TCK related work.
> https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing
>
> As you can see I executed today the tests from the  "appclient" category.
>
> One of the failing test is:
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> The way I'm executing just that tests is with the following command:
> ./runtests --web tomee-plume -c -sql active -da
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> Notice that I'm adding:
> -sql to enable (according to with runtests script code [1]) required
> databases to be created.
> -da to enable TCK appclient debug options (port 5003)
>
> Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
> debug configuration for Listen to Remote JVM at port: 5003
>
> Unfortunately, I'm not able to make this to work and degub the failing test.
>
>
> [1] https://github.com/apache/tomee-tck/blob/master/runtests#L30
> [2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38
> [3] https://jenkins.eclipse.org/jakartaee-tck/
>
> --
> Atentamente:
> César Hernández Mendoza.


--
Atentamente:
César Hernández Mendoza.
Reply | Threaded
Open this post in threaded view
|

Re: how to debug TCK tests?

David Jencks-3
H i Cesar,

I don’t see the javatest.log?

Have you found the command line that starts the app client, including the debug options?  I don’t think “listen mode” was available when I was working on this, I sure didn’t know about it!

The app client test harness is definitely involved, but I was wondering what was being started to be debugged… as I recall I sometimes needed to step through various test harnesses and sometimes through geronimo or test app code.  I remember all the options being quite confusing.

David Jencks

> On Jan 28, 2019, at 4:07 PM, César Hernández Mendoza <[hidden email]> wrote:
>
> Hi David,
> Thanks for the reply!
>
> Responding in line:
>
> Is the app client container starting?
> Yes,
>
> Does it suspend for the debugger attachment? If not, it probably runs to completion before you can attach-I definitely remember this happening to me!
> I don't suspend at all, the following command just runs and then crashess (you can check the attached javatest.log):
> ./runtests --web tomee-plume -c -sql active -da com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> Because it's doesn't suspend, I configure in the IDE [Listen to Remote JVM at port: 5003] instead of [Attach to Remote JVM at port: 5003].
> But that didn't work either.
>
> Is the test harness or appclient test harness (I don’t recall if these are separate) suspended waiting for attachment?
> Base on the naming convention [1] from the test, I think it's an appclient tests harness. How can I verify this?
>
> [1] https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/appclient/deploy/ejblink/single/Client.java <https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/appclient/deploy/ejblink/single/Client.java>
>
>
> El lun., 28 ene. 2019 a las 17:23, David Jencks (<[hidden email] <mailto:[hidden email]>>) escribió:
> From the distant past, I recall it being tricky to debug the app client tests. Can you tell what is happening?
> Is the app client container starting?
> Does it suspend for the debugger attachment? If not, it probably runs to completion before you can attach-I definitely remember this happening to me!
> Does it suspend but not allow attachment?
> Is the test harness or appclient test harness (I don’t recall if these are separate) suspended waiting for attachment?
>
> Hope this helps!
> David Jencks
>
> Sent from my iPhone
>
> > On Jan 28, 2019, at 2:31 PM, César Hernández Mendoza <[hidden email] <mailto:[hidden email]>> wrote:
> >
> > Hi,
> >
> > I created the following document to track my TCK related work.
> > https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing <https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing>
> >
> > As you can see I executed today the tests from the  "appclient" category.
> >
> > One of the failing test is:
> > com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
> >
> > The way I'm executing just that tests is with the following command:
> > ./runtests --web tomee-plume -c -sql active -da
> > com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
> >
> > Notice that I'm adding:
> > -sql to enable (according to with runtests script code [1]) required
> > databases to be created.
> > -da to enable TCK appclient debug options (port 5003)
> >
> > Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
> > debug configuration for Listen to Remote JVM at port: 5003
> >
> > Unfortunately, I'm not able to make this to work and degub the failing test.
> >
> >
> > [1] https://github.com/apache/tomee-tck/blob/master/runtests#L30 <https://github.com/apache/tomee-tck/blob/master/runtests#L30>
> > [2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38 <https://github.com/apache/tomee-tck/blob/master/runtests#L38>
> > [3] https://jenkins.eclipse.org/jakartaee-tck/ <https://jenkins.eclipse.org/jakartaee-tck/>
> >
> > --
> > Atentamente:
> > César Hernández Mendoza.
>
>
> --
> Atentamente:
> César Hernández Mendoza.

Reply | Threaded
Open this post in threaded view
|

Re: how to debug TCK tests?

jgallimore
In reply to this post by Cesar Hernandez
Hey Cesar

A few things get run during the tests, and they can be debugged by passing
the correct option(s) to the runtests script. You can get details if you do
runtests --help, but here's the options you want:

    -de,--debug-embedded    Enable TCK embedded ejb debug options (port
5001)
    -dh,--debug-harness     Enable TCK harness debug options (port 5002)
    -da,--debug-appclient   Enable TCK appclient debug options (port 5003)
    -dj,--debug-javatest    Enable TCK javatest debug options (port 5004)
    -ds,--debug-server      Enable Server debug options (port 5005)

The options you want somewhat inconveniently depend on what test you're
running. So for an app client test, you probably want -da and maybe -dj as
well. For a server test, most likely -ds (and maybe -da as well).

Its a bit like debugging an Arquillian test that uses @RunOnClient, using
the TomEE remote adapter. You can debug the test actually running in
surefire (-Dmaven.surefire.debug) and the server itself
(-Dopenejb.server.debug).

Hope that helps.

Jon

On Mon, Jan 28, 2019 at 10:31 PM César Hernández Mendoza <
[hidden email]> wrote:

> Hi,
>
> I created the following document to track my TCK related work.
>
> https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing
>
> As you can see I executed today the tests from the  "appclient" category.
>
> One of the failing test is:
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> The way I'm executing just that tests is with the following command:
> ./runtests --web tomee-plume -c -sql active -da
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> Notice that I'm adding:
>  -sql to enable (according to with runtests script code [1]) required
> databases to be created.
> -da to enable TCK appclient debug options (port 5003)
>
> Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
> debug configuration for Listen to Remote JVM at port: 5003
>
> Unfortunately, I'm not able to make this to work and degub the failing
> test.
>
>
> [1] https://github.com/apache/tomee-tck/blob/master/runtests#L30
> [2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38
> [3] https://jenkins.eclipse.org/jakartaee-tck/
>
> --
> Atentamente:
> César Hernández Mendoza.
>
Reply | Threaded
Open this post in threaded view
|

Re: how to debug TCK tests?

Cesar Hernandez
Hi,
Thank you all for the pointers.

I was able to connect to the test by running: 
./runtests --web tomee-plume -d com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11

I attached remotely first to port 5005 and then to 5003 (app client port).

This also works:
./runtests --web tomee-plume -c -da com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
./runtests --web tomee-plume -da -c com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11

One thing that I notice is that always in the IDE, the first time I try to attach the debugger fails with the message: 
"Error running 'jtHarness-5003': Unable to open debugger port (localhost:5003): java.net.ConnectException "Connection refused (Connection refused)"

Then when I click again the debuggers gets attached successfully.

This is how my remote configuration looks in IntelliJ for the appclient port (5003):


El mar., 29 ene. 2019 a las 10:37, Jonathan Gallimore (<[hidden email]>) escribió:
Hey Cesar

A few things get run during the tests, and they can be debugged by passing
the correct option(s) to the runtests script. You can get details if you do
runtests --help, but here's the options you want:

    -de,--debug-embedded    Enable TCK embedded ejb debug options (port
5001)
    -dh,--debug-harness     Enable TCK harness debug options (port 5002)
    -da,--debug-appclient   Enable TCK appclient debug options (port 5003)
    -dj,--debug-javatest    Enable TCK javatest debug options (port 5004)
    -ds,--debug-server      Enable Server debug options (port 5005)

The options you want somewhat inconveniently depend on what test you're
running. So for an app client test, you probably want -da and maybe -dj as
well. For a server test, most likely -ds (and maybe -da as well).

Its a bit like debugging an Arquillian test that uses @RunOnClient, using
the TomEE remote adapter. You can debug the test actually running in
surefire (-Dmaven.surefire.debug) and the server itself
(-Dopenejb.server.debug).

Hope that helps.

Jon

On Mon, Jan 28, 2019 at 10:31 PM César Hernández Mendoza <
[hidden email]> wrote:

> Hi,
>
> I created the following document to track my TCK related work.
>
> https://docs.google.com/spreadsheets/d/1oYO0RN-rg4Z7TgSLJ2u4iK4hOFHOXA49ech2y0N3kVw/edit?usp=sharing
>
> As you can see I executed today the tests from the  "appclient" category.
>
> One of the failing test is:
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> The way I'm executing just that tests is with the following command:
> ./runtests --web tomee-plume -c -sql active -da
> com/sun/ts/tests/appclient/deploy/ejblink/single/Client#testCMP11
>
> Notice that I'm adding:
>  -sql to enable (according to with runtests script code [1]) required
> databases to be created.
> -da to enable TCK appclient debug options (port 5003)
>
> Then on my IntelliJ, I opened Jakarta-tck project [3] and  set up a remote
> debug configuration for Listen to Remote JVM at port: 5003
>
> Unfortunately, I'm not able to make this to work and degub the failing
> test.
>
>
> [1] https://github.com/apache/tomee-tck/blob/master/runtests#L30
> [2]  https://github.com/apache/tomee-tck/blob/master/runtests#L38
> [3] https://jenkins.eclipse.org/jakartaee-tck/
>
> --
> Atentamente:
> César Hernández Mendoza.
>


--
Atentamente:
César Hernández Mendoza.