Skip to content
Permalink
Browse files
8269032: Stringdedup tests are failing if the ergonomically select GC…
… does not support it

Reviewed-by: tschatzl, lkorinth
  • Loading branch information
Kim Barrett committed Jul 19, 2021
1 parent a8f1542 commit 3fc761d97d43429d3fdc0646835c462e0fe1bd3e
Showing 7 changed files with 90 additions and 12 deletions.
@@ -27,17 +27,31 @@
* @test TestStringDeduplicationAgeThreshold
* @summary Test string deduplication age threshold
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1" | vm.gc == "Shenandoah"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationAgeThreshold
* @run driver gc.stringdedup.TestStringDeduplicationAgeThreshold G1
*/

/*
* @test TestStringDeduplicationAgeThreshold
* @summary Test string deduplication age threshold
* @bug 8029075
* @requires vm.gc.Shenandoah
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationAgeThreshold Shenandoah
*/

public class TestStringDeduplicationAgeThreshold {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testAgeThreshold();
}
}
@@ -27,17 +27,31 @@
* @test TestStringDeduplicationFullGC
* @summary Test string deduplication during full GC
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1" | vm.gc == "Shenandoah"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationFullGC
* @run driver gc.stringdedup.TestStringDeduplicationFullGC G1
*/

/*
* @test TestStringDeduplicationFullGC
* @summary Test string deduplication during full GC
* @bug 8029075
* @requires vm.gc.Shenandoah
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationFullGC Shenandoah
*/

public class TestStringDeduplicationFullGC {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testFullGC();
}
}
@@ -27,17 +27,18 @@
* @test TestStringDeduplicationInterned
* @summary Test string deduplication of interned strings
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationInterned
* @run driver gc.stringdedup.TestStringDeduplicationInterned G1
*/

public class TestStringDeduplicationInterned {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testInterned();
}
}
@@ -27,17 +27,31 @@
* @test TestStringDeduplicationPrintOptions
* @summary Test string deduplication print options
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1" | vm.gc == "Shenandoah"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationPrintOptions
* @run driver gc.stringdedup.TestStringDeduplicationPrintOptions G1
*/

/*
* @test TestStringDeduplicationPrintOptions
* @summary Test string deduplication print options
* @bug 8029075
* @requires vm.gc.Shenandoah
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationPrintOptions Shenandoah
*/

public class TestStringDeduplicationPrintOptions {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testPrintOptions();
}
}
@@ -27,17 +27,31 @@
* @test TestStringDeduplicationTableResize
* @summary Test string deduplication table resize
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1" | vm.gc == "Shenandoah"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationTableResize
* @run driver gc.stringdedup.TestStringDeduplicationTableResize G1
*/

/*
* @test TestStringDeduplicationTableResize
* @summary Test string deduplication table resize
* @bug 8029075
* @requires vm.gc.Shenandoah
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationTableResize Shenandoah
*/

public class TestStringDeduplicationTableResize {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testTableResize();
}
}
@@ -50,6 +50,8 @@ class TestStringDeduplicationTools {
private static Unsafe unsafe;
private static byte[] dummy;

private static String selectedGC = null;

static {
try {
Field field = Unsafe.class.getDeclaredField("theUnsafe");
@@ -63,6 +65,10 @@ class TestStringDeduplicationTools {
}
}

public static void selectGC(String[] args) {
selectedGC = args[0];
}

private static Object getValue(String string) {
try {
return valueField.get(string);
@@ -226,6 +232,7 @@ private static OutputAnalyzer runTest(String... extraArgs) throws Exception {
};

ArrayList<String> args = new ArrayList<String>();
args.add("-XX:+Use" + selectedGC + "GC");
args.addAll(Arrays.asList(defaultArgs));
args.addAll(Arrays.asList(extraArgs));

@@ -27,17 +27,31 @@
* @test TestStringDeduplicationYoungGC
* @summary Test string deduplication during young GC
* @bug 8029075
* @requires vm.gc == "null" | vm.gc == "G1" | vm.gc == "Shenandoah"
* @requires vm.gc.G1
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationYoungGC
* @run driver gc.stringdedup.TestStringDeduplicationYoungGC G1
*/

/*
* @test TestStringDeduplicationYoungGC
* @summary Test string deduplication during young GC
* @bug 8029075
* @requires vm.gc.Shenandoah
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
* @run driver gc.stringdedup.TestStringDeduplicationYoungGC Shenandoah
*/

public class TestStringDeduplicationYoungGC {
public static void main(String[] args) throws Exception {
TestStringDeduplicationTools.selectGC(args);
TestStringDeduplicationTools.testYoungGC();
}
}

5 comments on commit 3fc761d

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 3fc761d Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 3fc761d Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 3fc761d Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin The target repository jdk17-dev is not a valid target for backports.
List of valid target repositories: openjdk/jdk11u, openjdk/jdk11u-dev, openjdk/jdk12u, openjdk/jdk13u, openjdk/jdk13u-dev, openjdk/jdk14u, openjdk/jdk15u, openjdk/jdk15u-dev, openjdk/jdk16u, openjdk/jdk17u, openjdk/jdk17u-dev, openjdk/jdk18, openjdk/jdk18u.
Supplying the organization/group prefix is optional.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 3fc761d Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 3fc761d Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-3fc761d9 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 3fc761d9 from the openjdk/jdk repository.

The commit being backported was authored by Kim Barrett on 19 Jul 2021 and was reviewed by Thomas Schatzl and Leo Korinth.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-3fc761d9:GoeLin-backport-3fc761d9
$ git checkout GoeLin-backport-3fc761d9
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-3fc761d9

Please sign in to comment.