Skip to content

Commit

Permalink
8307448: Test RedefineSharedClassJFR fail due to wrong assumption
Browse files Browse the repository at this point in the history
Reviewed-by: eosterlund, coleenp
  • Loading branch information
kstefanj committed May 4, 2023
1 parent 408cec5 commit 29233e0
Showing 1 changed file with 7 additions and 9 deletions.
Expand Up @@ -24,7 +24,7 @@
/*
* @test
* @bug 8306929
* @summary Verify clean_previous_versions when run with JFR and CDS
* @summary Verify should_clean_previous_versions when run with JFR and CDS
* @requires vm.jvmti
* @requires vm.cds
* @requires vm.hasJFR
Expand Down Expand Up @@ -69,19 +69,17 @@ public static void main(String[] args) throws Exception {

if (args[0].equals("xshare-off")) {
// First case is with -Xshare:off. In this case no classes are shared
// and we should be able to clean out the retransformed classes. Verify
// that the cleaning is done when the GC is triggered.
// and we should be able to clean out the retransformed classes. There
// is no guarantee that any classes will be in use, so just verify that
// no classes are added due to being shared.
List<String> offCommand = new ArrayList<>();
offCommand.add("-Xshare:off");
offCommand.addAll(baseCommand);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(offCommand);
new OutputAnalyzer(pb.start())
.shouldContain(SHOULD_CLEAN_TRUE)
.shouldNotContain(SHOULD_CLEAN_FALSE)
// We expect at least one of the transformed classes to be in use, if
// not the above check that should_clean_previous should be true will also
// fail. This check is to show what is expected.
.shouldContain(SCRATCH_CLASS_ADDED_ON_STACK)
// We can't expect any of the transformed classes to be in use
// so the only thing we can verify is that no scratch classes
// are added because they are shared.
.shouldNotContain(SCRATCH_CLASS_ADDED_SHARED)
.shouldHaveExitValue(0);
return;
Expand Down

1 comment on commit 29233e0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.