Skip to content

Commit 631a72f

Browse files
author
duke
committedOct 13, 2021
Automatic merge of jdk:master into master
2 parents a9d2976 + d8f6b6c commit 631a72f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎test/hotspot/jtreg/runtime/cds/appcds/LambdaEagerInit.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -109,6 +109,7 @@ static void testWithEagerInitializationDisabled() throws Exception {
109109
static void testDefaultArchiveWithEagerInitializationEnabled() throws Exception {
110110
// run with default CDS archive with the -Djdk.internal.lambda.disableEagerInitialization=true property
111111
CDSOptions runOpts = (new CDSOptions())
112+
.setXShareMode("auto")
112113
.addPrefix("-cp", appJar, testProperty, "-Xlog:class+load,cds=debug")
113114
.setUseSystemArchive(true)
114115
.setUseVersion(false)
@@ -122,13 +123,16 @@ static void testDefaultArchiveWithEagerInitializationEnabled() throws Exception
122123
static void testDefaultArchiveWithEagerInitializationDisabled() throws Exception {
123124
// run with default CDS archive without the -Djdk.internal.lambda.disableEagerInitialization=true property
124125
CDSOptions runOpts = (new CDSOptions())
126+
.setXShareMode("auto")
125127
.addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug")
126128
.setUseSystemArchive(true)
127129
.setUseVersion(false)
128-
.addSuffix(mainClass);
130+
.addSuffix("-showversion", mainClass);
129131
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
130-
output.shouldMatch(lambdaLoadedFromArchive)
131-
.shouldMatch(cdsLoadedLambdaProxy)
132-
.shouldHaveExitValue(0);
132+
if (output.getStderr().contains("sharing")) {
133+
output.shouldMatch(lambdaLoadedFromArchive)
134+
.shouldMatch(cdsLoadedLambdaProxy);
135+
}
136+
output.shouldHaveExitValue(0);
133137
}
134138
}

0 commit comments

Comments
 (0)
Failed to load comments.