From jonathan.gibbons at oracle.com Thu Sep 11 17:18:45 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 11 Sep 2014 10:18:45 -0700 Subject: How to configure TestNG? In-Reply-To: <22BD637D-EAD3-40CD-B217-293095165A55@oracle.com> References: <53F4A0D4.4060007@oracle.com> <53FC71A3.5030400@oracle.com> <22BD637D-EAD3-40CD-B217-293095165A55@oracle.com> Message-ID: <5411D975.8050904@oracle.com> On 08/27/2014 12:27 AM, Alex Schenkman wrote: > Thanks for your answer Mike. > The point is not the verbose flag in itself, that was just an example. > > The use case for passing arguments to TestNG is to being able to fully > utilise what TestNG offers: > 1) specify my own implementation of ITestListener, for logging > test life cycle (started, passed, failed) > 2) specify my own IReporter, for getting the console output of > each test, with timestamps. > 3) specify at very detailed level what tests I want to run, and how. > > Yes, I think we should improve further the JTreg/TestNG integration. Alex, It is not a goal of the JTreg/TestNG integration to provide support for all TestNG features. There are enough discrepancies between the two systems for this to be impractical to the point of impossibility. The goal of the integration is to provide "good enough" support for a "good enough" set of the features, so that folk can write "good enough" tests in TestNG and have them be run with jtreg. Yes, we can discuss the definition of "good enough" but there are some inherent architectural limitations imposed by jtreg. If you want the full feature set of TestNG, use TestNG. Depending on how/where you are writing tests, that may be an option. But if you are writing tests for OpenJDK or for use within the existing Oracle infrastructure for building and running tests, you would be faced with the task of extending that infrastructure to "go it alone" with TestNG. There is a possible interim position. It is intended that it should be easy to develop TestNG tests within an IDE. So, while you are developing and debugging a test you may be able to use more of the fancy features, and then remove them when you have a working test that can be integrated into one of the OpenJDK test suites. -- Jon From weijun.wang at oracle.com Tue Sep 30 06:44:53 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Tue, 30 Sep 2014 14:44:53 +0800 Subject: Test an infinite loop? Message-ID: 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 From jonathan.gibbons at oracle.com Tue Sep 30 17:54:56 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Tue, 30 Sep 2014 10:54:56 -0700 Subject: Test an infinite loop? In-Reply-To: References: Message-ID: <542AEE70.60106@oracle.com> 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 >