7152866: Tests not run because they are missing the @run tag
I was looking at a test and happen to notice that it had a @build tag but no @run tag so the test wasn't actually running as expected (it wasn't a compile-only test). This prompted me to do a quick audit and I found several other tests with similar issues. The following webrev fixes the test description of several of these tests: http://cr.openjdk.java.net/~alanb/7152866/webrev/ Note that I didn't fix all the tests. It turns out that some of these tests don't compile or or fail on one or more platforms. I've created bugs for these [1]. TestX11CS.java is one case where it's not worth trying to fix it to compile so I propose to delete it. I've used the opportunity to remove some tests from the ProblemList while I was there. Thanks, Alan. [1] 7152856: TEST_BUG: sun/net/www/protocol/jar/B4957695.java failing on Windows 7152799: javax/naming/spi/DirectoryManager/GetContDirCtx.java failing with CannotProceedException 7152798: TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile 7152796: TEST_BUG: java/net/Socks/SocksV4Test.java does not terminate
I would think scanning for test files that have a main() method but not a @run tag would be a good way to find more of these... On Mar 11, 2012, at 4:21 AM, Alan Bateman wrote:
I was looking at a test and happen to notice that it had a @build tag but no @run tag so the test wasn't actually running as expected (it wasn't a compile-only test). This prompted me to do a quick audit and I found several other tests with similar issues. The following webrev fixes the test description of several of these tests:
http://cr.openjdk.java.net/~alanb/7152866/webrev/
Note that I didn't fix all the tests. It turns out that some of these tests don't compile or or fail on one or more platforms. I've created bugs for these [1]. TestX11CS.java is one case where it's not worth trying to fix it to compile so I propose to delete it.
I've used the opportunity to remove some tests from the ProblemList while I was there.
Thanks, Alan.
[1] 7152856: TEST_BUG: sun/net/www/protocol/jar/B4957695.java failing on Windows 7152799: javax/naming/spi/DirectoryManager/GetContDirCtx.java failing with CannotProceedException 7152798: TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile 7152796: TEST_BUG: java/net/Socks/SocksV4Test.java does not terminate
On 11/03/2012 17:06, Brian Goetz wrote:
I would think scanning for test files that have a main() method but not a @run tag would be a good way to find more of these...
We definitely should setup a script or something to catch these issues automatically, just need to work out what the pattern. The @run tag isn't needed when the default suffice (for .java tests it's compile + run, for .sh tests it's run). -Alan
Hi Alan, On 11/03/2012 9:21 PM, Alan Bateman wrote:
I was looking at a test and happen to notice that it had a @build tag but no @run tag so the test wasn't actually running as expected (it wasn't a compile-only test). This prompted me to do a quick audit and I found several other tests with similar issues. The following webrev fixes the test description of several of these tests:
What are all the @clean tag deletions? In a file Foo.java, isn't "@run Foo" implied? David
Note that I didn't fix all the tests. It turns out that some of these tests don't compile or or fail on one or more platforms. I've created bugs for these [1]. TestX11CS.java is one case where it's not worth trying to fix it to compile so I propose to delete it.
I've used the opportunity to remove some tests from the ProblemList while I was there.
Thanks, Alan.
[1] 7152856: TEST_BUG: sun/net/www/protocol/jar/B4957695.java failing on Windows 7152799: javax/naming/spi/DirectoryManager/GetContDirCtx.java failing with CannotProceedException 7152798: TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile 7152796: TEST_BUG: java/net/Socks/SocksV4Test.java does not terminate
On 11/03/2012 20:15, David Holmes wrote:
Hi Alan,
On 11/03/2012 9:21 PM, Alan Bateman wrote:
I was looking at a test and happen to notice that it had a @build tag but no @run tag so the test wasn't actually running as expected (it wasn't a compile-only test). This prompted me to do a quick audit and I found several other tests with similar issues. The following webrev fixes the test description of several of these tests:
What are all the @clean tag deletions?
I believe these removals are necessary to trigger the running of the tests. By default, if no tags are specified the default is "@run main <name>". But, "@clean <name>" is short for "@run clean <name>", so there will be no action to actually run the test. If we really need the clean tags, then a specific "@run main <name>" tag is needed. -Chris.
In a file Foo.java, isn't "@run Foo" implied?
David
Note that I didn't fix all the tests. It turns out that some of these tests don't compile or or fail on one or more platforms. I've created bugs for these [1]. TestX11CS.java is one case where it's not worth trying to fix it to compile so I propose to delete it.
I've used the opportunity to remove some tests from the ProblemList while I was there.
Thanks, Alan.
[1] 7152856: TEST_BUG: sun/net/www/protocol/jar/B4957695.java failing on Windows 7152799: javax/naming/spi/DirectoryManager/GetContDirCtx.java failing with CannotProceedException 7152798: TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile 7152796: TEST_BUG: java/net/Socks/SocksV4Test.java does not terminate
On 12/03/2012 8:12 AM, chris hegarty wrote:
On 11/03/2012 20:15, David Holmes wrote:
On 11/03/2012 9:21 PM, Alan Bateman wrote:
I was looking at a test and happen to notice that it had a @build tag but no @run tag so the test wasn't actually running as expected (it wasn't a compile-only test). This prompted me to do a quick audit and I found several other tests with similar issues. The following webrev fixes the test description of several of these tests:
What are all the @clean tag deletions?
I believe these removals are necessary to trigger the running of the tests.
By default, if no tags are specified the default is "@run main <name>". But, "@clean <name>" is short for "@run clean <name>", so there will be no action to actually run the test.
If we really need the clean tags, then a specific "@run main <name>" tag is needed.
Thanks Chris. I hadn't realized that @build, @clean etc were shorthand for @run build, @run clean etc. I would have assumed there was an implicit @run main (or whatever) in all those cases. :( David
-Chris.
In a file Foo.java, isn't "@run Foo" implied?
David
Note that I didn't fix all the tests. It turns out that some of these tests don't compile or or fail on one or more platforms. I've created bugs for these [1]. TestX11CS.java is one case where it's not worth trying to fix it to compile so I propose to delete it.
I've used the opportunity to remove some tests from the ProblemList while I was there.
Thanks, Alan.
[1] 7152856: TEST_BUG: sun/net/www/protocol/jar/B4957695.java failing on Windows 7152799: javax/naming/spi/DirectoryManager/GetContDirCtx.java failing with CannotProceedException 7152798: TEST_BUG: sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java does not compile 7152796: TEST_BUG: java/net/Socks/SocksV4Test.java does not terminate
On 11/03/2012 22:38, David Holmes wrote:
Thanks Chris. I hadn't realized that @build, @clean etc were shorthand for @run build, @run clean etc. I would have assumed there was an implicit @run main (or whatever) in all those cases. :(
Yes, @build, @clean, @compile are just short hand. For simple tests that are just a single source file with a main method then @test is sufficient. So are you okay with the changes? -Alan.
On 12/03/2012 09:42, Alan Bateman wrote:
On 11/03/2012 22:38, David Holmes wrote:
Thanks Chris. I hadn't realized that @build, @clean etc were shorthand for @run build, @run clean etc. I would have assumed there was an implicit @run main (or whatever) in all those cases. :(
Yes, @build, @clean, @compile are just short hand. For simple tests that are just a single source file with a main method then @test is sufficient. So are you okay with the changes?
Oh sorry, forgot to say. I'm, ok with with this change. -Chris.
-Alan.
participants (4)
-
Alan Bateman
-
Brian Goetz
-
chris hegarty
-
David Holmes