Andrew McGuigan wrote:
> Hi all,
>
> sometimes when I run my test script I get this error:
>
> java.io.InterruptedIOException: Connection establishment timed out
>
> i have the following code in my script:
>
> control = HTTPPluginControl.getConnectionDefaults()
> control.setTimeout(30)
>
> as suggested on the website.
I think The Grinder really ought to handle this itself. Please open a bug.
> I would like to catch these errors and report them as fails in my
> results. Can anyone point me to a code-snippet or give me a brief
> outline on what i need to do?
You need to add an exception handler, and also update the statistics.
Something like:
grinder.statistics.delayReports=1
try:
myRequest.GET(...)
except InterruptedIOException: # Assume its because of a timeout
grinder.statistics.forLastTest.success = 0
- Phil
|