Test an infinite loop?
Jonathan Gibbons
jonathan.gibbons at oracle.com
Tue Sep 30 17:54:56 UTC 2014
What execution mode are you using?
Timeouts are difficult to handle, especially when not using /othervm mode.
In othervm mode, jtreg tries to kill the process. That is problematic in
itself, because Java does not yet provide a good way of killing a
process tree, so killing the process may leave and child processes around.
In samevm or agentvm mode, jtreg tries to interrupt a test using the
standard interrupt mechanism. But it's possibly for a badly behaved test
to ignore interrupts, and that looks like what is going on here.
Eventually, in agentvm mode, jtreg will try and kill the agent process
itself. That should happen 1 minute after jtreg initially signals a
timeout.
I don't yet understand where the 180 is coming from.
-- Jon
On 09/29/2014 11:44 PM, Wang Weijun wrote:
> I'd like to write a jtreg test that confirms an infinite loop is fixed. That is to say, before the fix there was an infinite loop and now there is none. I tried to add a @run main/timeout=2 action and run the test with an old JDK and it still runs for 3 minutes showing
>
> Timeout signalled after 2 seconds
> Test not responding after 100 interrupts
> Test not responding after 200 interrupts
> Test not responding after 300 interrupts
> Test not responding after 400 interrupts
> Test not responding after 500 interrupts
> Timeout signalled after 62 seconds
> Test not responding after 100 interrupts
> Test not responding after 200 interrupts
> Test not responding after 300 interrupts
> Test not responding after 400 interrupts
> Test not responding after 500 interrupts
> elapsed time (seconds): 180.008
>
> Why isn't it killed at 2 seconds?
>
> Thanks
> Max
>
More information about the jtreg-use
mailing list