[TESTBUG]: Syntax error in test description of jdk8u-dev/.../JcmdWithNMTDisabled.java ?

Volker Simonis volker.simonis at gmail.com
Fri Jun 26 09:09:49 UTC 2015


Hi,

after I've upgraded to the latest and greatest version of JTreg
(168:055251d38f29 "minor naming cleanup in Agent") I get an error when
executing the hotspot test:

runtime/NMT/JcmdWithNMTDisabled.java

from the jdk8u-dev (notice that the same test from the jdk9 forest
runs just fine because it was already refactored).

I think this is because of the strange tag syntax the test uses:

/*
 * @test
 * @key nmt jcmd
 * @summary Verify that jcmd correctly reports that NMT is not enabled
 * @library /testlibrary
 * First run without enabling NMT
 * @run main/othervm JcmdWithNMTDisabled
 * Then run with explicitly disabling NMT, should not be any difference
 * @run main/othervm -XX:NativeMemoryTracking=off JcmdWithNMTDisabled
 */

The problem is that the comment line "First run without enabling NMT"
will be appended to the "@library" tag like this:

@library /testlibrary First run without enabling NMT

yielding in strange class paths during execution which contain
"<path>/First:<path>/run:<path>/without:...". But apparently this
doesn't confuse older version of JTreg too much because the test
succeeded nevertheless.

However with the newest JTreg version the test badly fails with the error:

test result: Error. Test Class Exception: Can't find library: First

Notice that "First" is the first word of the comment line "First run
without enabling NMT" in the tag description.

So is this indeed an error in the test description of
JcmdWithNMTDisabled.java and should it be fixed by removing the two
lines:

  * @library /testlibrary
- * First run without enabling NMT
  * @run main/othervm JcmdWithNMTDisabled
- * Then run with explicitly disabling NMT, should not be any difference
  * @run main/othervm -XX:NativeMemoryTracking=off JcmdWithNMTDisabled

from the test description to make it runnable with newer JTreg versions as well?

Regards,
Volker


More information about the code-tools-dev mailing list