From martinrb at google.com Wed Mar 12 15:54:46 2014 From: martinrb at google.com (Martin Buchholz) Date: Wed, 12 Mar 2014 08:54:46 -0700 Subject: Printing stack traces for hung tests Message-ID: If a test fails to finish on time, the question is always "show me the stack trace". It would be nice if jtreg could run jstack on all timed-out tests by default. It would also be nice if the stack trace provided by jstack was available in API form in a discoverable place. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.gibbons at oracle.com Wed Mar 12 16:00:02 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 12 Mar 2014 09:00:02 -0700 Subject: Printing stack traces for hung tests In-Reply-To: References: Message-ID: <53208482.9020703@oracle.com> On 03/12/2014 08:54 AM, Martin Buchholz wrote: > If a test fails to finish on time, the question is always "show me the > stack trace". > It would be nice if jtreg could run jstack on all timed-out tests by > default. > It would also be nice if the stack trace provided by jstack was > available in API form in a discoverable place. Martin, Yes, this is on the list for the next go-round on jtreg. -- Jon From david.holmes at oracle.com Mon Mar 31 05:59:39 2014 From: david.holmes at oracle.com (David Holmes) Date: Mon, 31 Mar 2014 15:59:39 +1000 Subject: Creating jar files as part of a test? Message-ID: <5339044B.8060806@oracle.com> I need to dynamically create a jar file containing some of the classes that form my test, and then use that jar file on a secondary exec of the VM (using ProcessTools). Given we aren't supposed to check-in binary files to the repos, what is the simplest way to generate a jar file using jtreg? Thanks, David From weijun.wang at oracle.com Mon Mar 31 06:08:47 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Mon, 31 Mar 2014 14:08:47 +0800 Subject: Creating jar files as part of a test? In-Reply-To: <5339044B.8060806@oracle.com> References: <5339044B.8060806@oracle.com> Message-ID: test/java/util/jar/Manifest/CreateManifest.java has: String [] args = new String [] { "cvfm", jarFileName, ManifestName}; sun.tools.jar.Main jartool = new sun.tools.jar.Main(System.out, System.err, "jar"); jartool.run(args); --Max On Mar 31, 2014, at 13:59, David Holmes wrote: > I need to dynamically create a jar file containing some of the classes that form my test, and then use that jar file on a secondary exec of the VM (using ProcessTools). Given we aren't supposed to check-in binary files to the repos, what is the simplest way to generate a jar file using jtreg? > > Thanks, > David From david.holmes at oracle.com Mon Mar 31 06:13:19 2014 From: david.holmes at oracle.com (David Holmes) Date: Mon, 31 Mar 2014 16:13:19 +1000 Subject: Creating jar files as part of a test? In-Reply-To: References: <5339044B.8060806@oracle.com> Message-ID: <5339077F.1060307@oracle.com> On 31/03/2014 4:08 PM, Wang Weijun wrote: > test/java/util/jar/Manifest/CreateManifest.java has: > > String [] args = new String [] { "cvfm", jarFileName, ManifestName}; > sun.tools.jar.Main jartool = > new sun.tools.jar.Main(System.out, System.err, "jar"); > jartool.run(args); Thanks Max. I should have clarified that of course one option is to simply run the jar tool programmatically :) But in that case I don't know how to tell it where to find the files that jtreg has compiled - are they simply in the current working directory? (Guess I can find out readily enough :) ). Cheers, David > --Max > > On Mar 31, 2014, at 13:59, David Holmes wrote: > >> I need to dynamically create a jar file containing some of the classes that form my test, and then use that jar file on a secondary exec of the VM (using ProcessTools). Given we aren't supposed to check-in binary files to the repos, what is the simplest way to generate a jar file using jtreg? >> >> Thanks, >> David > From weijun.wang at oracle.com Mon Mar 31 06:21:23 2014 From: weijun.wang at oracle.com (Wang Weijun) Date: Mon, 31 Mar 2014 14:21:23 +0800 Subject: Creating jar files as part of a test? In-Reply-To: <5339077F.1060307@oracle.com> References: <5339044B.8060806@oracle.com> <5339077F.1060307@oracle.com> Message-ID: They are in test.classes (system property) I guess. If you are willing to create MANIFEST.MF yourself (or suppose it's not necessary for you), it's also OK to open a ZipOutputStream, and (putNextEntry, write)*. --Max On Mar 31, 2014, at 14:13, David Holmes wrote: > On 31/03/2014 4:08 PM, Wang Weijun wrote: >> test/java/util/jar/Manifest/CreateManifest.java has: >> >> String [] args = new String [] { "cvfm", jarFileName, ManifestName}; >> sun.tools.jar.Main jartool = >> new sun.tools.jar.Main(System.out, System.err, "jar"); >> jartool.run(args); > > Thanks Max. I should have clarified that of course one option is to simply run the jar tool programmatically :) But in that case I don't know how to tell it where to find the files that jtreg has compiled - are they simply in the current working directory? (Guess I can find out readily enough :) ). > > Cheers, > David > >> --Max >> >> On Mar 31, 2014, at 13:59, David Holmes wrote: >> >>> I need to dynamically create a jar file containing some of the classes that form my test, and then use that jar file on a secondary exec of the VM (using ProcessTools). Given we aren't supposed to check-in binary files to the repos, what is the simplest way to generate a jar file using jtreg? >>> >>> Thanks, >>> David >> From jonathan.gibbons at oracle.com Mon Mar 31 17:23:30 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 31 Mar 2014 10:23:30 -0700 Subject: Creating jar files as part of a test? In-Reply-To: References: <5339044B.8060806@oracle.com> <5339077F.1060307@oracle.com> Message-ID: <5339A492.5020200@oracle.com> If you are going to use test.classes, then a) you probably want your test to be the only test in its containing directory -- otherwise you'll get the classes from other tests in your jar file b) you probably don't want to use library code (@library) because those classes will be stored somewhere else. -- Jon On 03/30/2014 11:21 PM, Wang Weijun wrote: > They are in test.classes (system property) I guess. > > If you are willing to create MANIFEST.MF yourself (or suppose it's not necessary for you), it's also OK to open a ZipOutputStream, and (putNextEntry, write)*. > > --Max > > On Mar 31, 2014, at 14:13, David Holmes wrote: > >> On 31/03/2014 4:08 PM, Wang Weijun wrote: >>> test/java/util/jar/Manifest/CreateManifest.java has: >>> >>> String [] args = new String [] { "cvfm", jarFileName, ManifestName}; >>> sun.tools.jar.Main jartool = >>> new sun.tools.jar.Main(System.out, System.err, "jar"); >>> jartool.run(args); >> Thanks Max. I should have clarified that of course one option is to simply run the jar tool programmatically :) But in that case I don't know how to tell it where to find the files that jtreg has compiled - are they simply in the current working directory? (Guess I can find out readily enough :) ). >> >> Cheers, >> David >> >>> --Max >>> >>> On Mar 31, 2014, at 13:59, David Holmes wrote: >>> >>>> I need to dynamically create a jar file containing some of the classes that form my test, and then use that jar file on a secondary exec of the VM (using ProcessTools). Given we aren't supposed to check-in binary files to the repos, what is the simplest way to generate a jar file using jtreg? >>>> >>>> Thanks, >>>> David From jonathan.gibbons at oracle.com Mon Mar 31 18:12:10 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 31 Mar 2014 11:12:10 -0700 Subject: Printing stack traces for hung tests In-Reply-To: References: Message-ID: <5339AFFA.2000304@oracle.com> On 03/12/2014 08:54 AM, Martin Buchholz wrote: > If a test fails to finish on time, the question is always "show me the > stack trace". > It would be nice if jtreg could run jstack on all timed-out tests by > default. > It would also be nice if the stack trace provided by jstack was > available in API form in a discoverable place. https://bugs.openjdk.java.net/browse/CODETOOLS-7900878