Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [hono-dev] How to debug Hono-code

What do you exactly mean by "times out"? The unit test? Because I've never ever seen the Eclipse debugger time out in any way.

On Thu, Apr 12, 2018 at 12:36 PM, Alfusainey Jallow <alf.jallow@xxxxxxxxx> wrote:
Hi Kai,

Thank you! Initially, I commented out the timeout rule. Now i increase the value to 3600 secs + use the vertxoptions as in 1. At least now I can inspect my breakpoints for 3-4 mins before it times out but not more. 3600 secs is 1 hour but it times out long before that. Any idea?


2018-04-12 10:13 GMT+02:00 Hudalla Kai (INST/ECS4) <kai.hudalla@xxxxxxxxxxxx>:
On Wed, 2018-04-11 at 23:14 +0200, Alfusainey Jallow wrote:
> Hi Kai & hono-devs,
>
> I need some help. I am trying to step-through the http adapter code using the
> eclipse built-in debugger. I want to see internally what happens when a http
> client tries to upload telemetry data (from the point when the client made the
> request until the point where the AMQP 1.0 message is sent to the telemetry
> endpoint).
>
> The test case am considering is
> testPostTelemetrySucceedsForValidCredentials(...) of the
> VertxBasedHttpProtocolAdapterTest
>
> The problem that I am facing is that the debugger times out and as a result
> terminates after a short time. During setting up the adapter, I tried doing the
> ff:
>
> 1. Using Long.MAX_VALUE as the max value for the event-loop execution time
> > VertxOptions options = new
> > VertxOptions().setMaxEventLoopExecuteTime(Long.MAX_VALUE);
> > vertx = Vertx.vertx(options);
> > ...
>
> 2. Set the adapter as a worker thread:
> > vertx.deployVerticle(httpAdapter, new DeploymentOptions().setWorker(true),
> > ctx.asyncAssertSuccess());
>
> In both setups, the debugger times out before i reach the
> AbstractVertxBasedHttpProtocolAdapter#doUploadMessage(..) method
>
> How can I work around this problem so that I have a lot of time before the
> debugger times out? how do you debug hono code?
>

I do not think that running the adapter on a worker thread helps a lot. The
problem is more likely to be related to the test case itself timing out.

The VertxBasedHttpProtocolAdapterTest test class defines a Timeout rule at the
top of the class which defines a timout period of 5 seconds for each test case.
You may try to increase this value to e.g. 60 seconds in order for the test case
to not time out prematurely before you were able to inspect your breakpoints ...

Let me know if that works for you ...


> kind regards
> --
> alfu



--
alfu

_______________________________________________
hono-dev mailing list
hono-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/hono-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill

Back to the top