You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Olivier Grisel <ol...@ensta.org> on 2011/02/10 17:11:33 UTC

Debugging integration tests

Hi again Bertrand,

Hudson is breaking with:

https://hudson.apache.org/hudson/job/stanbol-trunk-1.6/3/org.apache.stanbol$org.apache.stanbol.enhancer.integration-tests/console

SEVERE: A message body writer for Java class
org.apache.clerezza.rdf.core.impl.SimpleMGraph, and Java type class
org.apache.clerezza.rdf.core.impl.SimpleMGraph, and MIME media type
application/octet-stream was not found
Feb 10, 2011 3:33:01 PM com.sun.jersey.spi.container.ContainerResponse
traceException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException
	at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:267)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1035)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:947)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:938)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:399)
[...]

I can reproduce the issue on my machine but I don't really know how to
setup the debugger on the launched hosts. Where should I pass
additional command line properties to launched jvm? For instance I
would like to be able to add:

  -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y


Also when trying to launch from eclipse, I get:

  java.lang.Exception: Missing property: server.ready.timeout.seconds
	at org.apache.stanbol.commons.testing.stanbol.StanbolTestBase.waitForServerReady(StanbolTestBase.java:88)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        [...]

I am planning to add a default value of 10 seconds. Any objection?

Also I regularly get out of memory exceptions (I would like to make
possible to pass reasonable -Xmx value) and leftover stanbol instances
that I have to kill manually.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: Debugging integration tests

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Feb 10, 2011 at 5:25 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> ...I've usually been tracking these things by adding more details to the
> tests failure outputs - which also helps improve our tests....

I just looked and we do have enough info from the failing tests, at

https://hudson.apache.org/hudson/view/S-Z/view/Stanbol/job/stanbol-trunk-1.6/org.apache.stanbol$org.apache.stanbol.enhancer.integration-tests/3/testReport/org.apache.stanbol.enhancer.it/StatelessEngineTest/testSimpleEnhancement/

I enclose the output below, it shows that some enhancement engines are
not started, or maybe not yet - we might need to improve the "server
ready" detection.

Best might be to add a test at startup that uses the OSGi console to
verify that all required services are up.

-Bertrand


Output is

<urn:content-item-sha1-37c8a8244041cf6113d4ee04b3a04d0a014f6e10>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument>
.
<urn:content-item-sha1-37c8a8244041cf6113d4ee04b3a04d0a014f6e10>
<http://www.semanticdesktop.org/ontologies/2007/01/19/nie#plainTextContent>
"The Stanbol enhancer can detect famous cities such as Paris and
people such as Bob Marley." .
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://fise.iks-project.eu/ontology/Enhancement> .
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://fise.iks-project.eu/ontology/extracted-from>
<urn:content-item-sha1-37c8a8244041cf6113d4ee04b3a04d0a014f6e10> .
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://purl.org/dc/terms/created>
"2011-02-10T15:23:48.185+00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>
.
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://purl.org/dc/terms/creator>
"org.apache.stanbol.enhancer.engines.metaxa.MetaxaEngine"^^<http://www.w3.org/2001/XMLSchema#string>
.
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://fise.iks-project.eu/ontology/TextAnnotation> .
<urn:enhancement-98984bd5-b470-5ead-d36c-4bf07f2ccb5d>
<http://fise.iks-project.eu/ontology/confidence>
"1.0"^^<http://www.w3.org/2001/XMLSchema#double> .
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://purl.org/dc/terms/language> "en" .
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://fise.iks-project.eu/ontology/Enhancement> .
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://fise.iks-project.eu/ontology/extracted-from>
<urn:content-item-sha1-37c8a8244041cf6113d4ee04b3a04d0a014f6e10> .
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://purl.org/dc/terms/created>
"2011-02-10T15:23:48.281+00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>
.
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://purl.org/dc/terms/creator>
"org.apache.stanbol.enhancer.engines.langid.LangIdEnhancementEngine"^^<http://www.w3.org/2001/XMLSchema#string>
.
<urn:enhancement-44df4379-e386-71a5-9963-bcb1c0be4cf7>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://fise.iks-project.eu/ontology/TextAnnotation>

Re: Debugging integration tests

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Feb 10, 2011 at 10:58 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
>... Ah sorry missed that, integration-tests/README.txt explains how to
> debug the integration tests using Maven (I just added a mention of
> -Dmaven.surefire.debug to it)...

Also added -Dhttp.port=8080 to that now, lets you run the jar under
test on a specific port instead of random.

-Bertrand

Re: Debugging integration tests

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Feb 10, 2011 at 5:47 PM, Olivier Grisel
<ol...@ensta.org> wrote:
> 2011/2/10 Bertrand Delacretaz <bd...@apache.org>:
>> On Thu, Feb 10, 2011 at 5:11 PM, Olivier Grisel
>> <ol...@ensta.org> wrote:
>>>...I don't really know how to
>>> setup the debugger on the launched hosts. Where should I pass
>>> additional command line properties to launched jvm? For instance I
>>> would like to be able to add:
>>>
>>>  -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
>>
>> I don't think that's acceptable as that would block the whole Hudson
>> build that other projects use.
>
> I do not want that turn on by default. I just want to know if there is
> a clean way to configure the executed JVM with such custom options
> when debugging on my machine....

Ah sorry missed that, integration-tests/README.txt explains how to
debug the integration tests using Maven (I just added a mention of
-Dmaven.surefire.debug to it).

It should be easy to adapt those instructions for Eclipse, but
starting the server instance at the command line is probably easier,
and just run the tests from Eclipse by setting the appropriate system
properties (see pom for that).

-Bertrand

Re: Debugging integration tests

Posted by Olivier Grisel <ol...@ensta.org>.
2011/2/10 Bertrand Delacretaz <bd...@apache.org>:
> Hi Olivier,
>
> On Thu, Feb 10, 2011 at 5:11 PM, Olivier Grisel
> <ol...@ensta.org> wrote:
>> Hudson is breaking with:
>>
>> https://hudson.apache.org/hudson/job/stanbol-trunk-1.6/3/org.apache.stanbol$org.apache.stanbol.enhancer.integration-tests/console
>>
>> SEVERE: A message body writer for Java class
>> org.apache.clerezza.rdf.core.impl.SimpleMGraph, and Java type class
>> org.apache.clerezza.rdf.core.impl.SimpleMGraph, and MIME media type
>> application/octet-stream was not found
>
> I don't think that's what causes the tests to fail, that's expected
> due to StatelessEngineTest.testInvalidFormat()
>
> I'll have a look tomorrow at what might be the real cause.
>
>>...I don't really know how to
>> setup the debugger on the launched hosts. Where should I pass
>> additional command line properties to launched jvm? For instance I
>> would like to be able to add:
>>
>>  -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
>
> I don't think that's acceptable as that would block the whole Hudson
> build that other projects use.

I do not want that turn on by default. I just want to know if there is
a clean way to configure the executed JVM with such custom options
when debugging on my machine.

By looking at your later reply I will try to configure my eclipse with:

-Djar.executor.vm.options="-Xmx1g -Xdebug
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"

If it works I will update the README.

> I've usually been tracking these things by adding more details to the
> tests failure outputs - which also helps improve our tests.

True but sometimes the debugging is necessary.

> Another option is to ask for shell access on the machines that run the
> build, to test our stuff in the same environment.
>
>> Also when trying to launch from eclipse, I get:
>>
>>  java.lang.Exception: Missing property: server.ready.timeout.seconds
>>...
>> I am planning to add a default value of 10 seconds. Any objection?
>
> the default in the pom is 60 seconds, better use the same.

Noted.

>> Also I regularly get out of memory exceptions (I would like to make
>> possible to pass reasonable -Xmx value) and leftover stanbol instances
>> that I have to kill manually...
>
> Look at the integration-tests/pom.xml for default values that are used
> in the maven build. You can probably set system properties in your
> eclipse project to do the same?

Ok thanks.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: Debugging integration tests

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Olivier,

On Thu, Feb 10, 2011 at 5:11 PM, Olivier Grisel
<ol...@ensta.org> wrote:
> Hudson is breaking with:
>
> https://hudson.apache.org/hudson/job/stanbol-trunk-1.6/3/org.apache.stanbol$org.apache.stanbol.enhancer.integration-tests/console
>
> SEVERE: A message body writer for Java class
> org.apache.clerezza.rdf.core.impl.SimpleMGraph, and Java type class
> org.apache.clerezza.rdf.core.impl.SimpleMGraph, and MIME media type
> application/octet-stream was not found

I don't think that's what causes the tests to fail, that's expected
due to StatelessEngineTest.testInvalidFormat()

I'll have a look tomorrow at what might be the real cause.

>...I don't really know how to
> setup the debugger on the launched hosts. Where should I pass
> additional command line properties to launched jvm? For instance I
> would like to be able to add:
>
>  -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y

I don't think that's acceptable as that would block the whole Hudson
build that other projects use.

I've usually been tracking these things by adding more details to the
tests failure outputs - which also helps improve our tests.

Another option is to ask for shell access on the machines that run the
build, to test our stuff in the same environment.

> Also when trying to launch from eclipse, I get:
>
>  java.lang.Exception: Missing property: server.ready.timeout.seconds
>...
> I am planning to add a default value of 10 seconds. Any objection?

the default in the pom is 60 seconds, better use the same.

>
> Also I regularly get out of memory exceptions (I would like to make
> possible to pass reasonable -Xmx value) and leftover stanbol instances
> that I have to kill manually...

Look at the integration-tests/pom.xml for default values that are used
in the maven build. You can probably set system properties in your
eclipse project to do the same?

-Bertrand