Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8279970: two AppCDS tests fail after JDK-8261455 #7070

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -103,8 +103,6 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64
runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64
runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64
runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java 8279970 generic-all
runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc 8279970 generic-all

applications/jcstress/copy.java 8229852 linux-all

@@ -38,6 +38,7 @@ class DynamicArchiveTestBase {
private static boolean executedIn_run = false;
private static boolean autoMode = false; // -Xshare:auto
private static final WhiteBox WB = WhiteBox.getWhiteBox();
private static String[] baseArchiveOptions = new String[] {};

public static interface DynamicArchiveTest {
public void run() throws Exception;
@@ -95,6 +96,10 @@ public static String getNewArchiveName(String stem) {
return TestCommon.getNewArchiveName(stem);
}

public static void setBaseArchiveOptions(String... opts) {
baseArchiveOptions = opts;
}

/**
* Excute a JVM to dump a base archive by
* -Xshare:dump -XX:SharedArchiveFile=baseArchiveName
@@ -286,7 +291,7 @@ public static void dumpAndRun(String topArchiveName, String ... cmdLineSuffix) t
private static String getTempBaseArchive() throws Exception {
if (tempBaseArchive == null) {
tempBaseArchive = getNewArchiveName("tempBaseArchive");
TestCommon.dumpBaseArchive(tempBaseArchive);
TestCommon.dumpBaseArchive(tempBaseArchive, baseArchiveOptions);
}
return tempBaseArchive;
}
@@ -101,7 +101,6 @@

import java.io.IOException;
import java.io.File;

import java.nio.file.attribute.FileTime;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -111,6 +110,8 @@
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.helpers.ClassFileInstaller;

import jtreg.SkippedException;

public class TestAutoCreateSharedArchive extends DynamicArchiveTestBase {
private static final String BASE_NAME = CDSTestUtils.getOutputFileName("base.jsa");
private static final String TOP_NAME = CDSTestUtils.getOutputFileName("top.jsa");
@@ -123,6 +124,9 @@ public class TestAutoCreateSharedArchive extends DynamicArchiveTestBase {
private static int currentCDSVersion = CDSArchiveUtils.getCurrentCDSArchiveVersion();

public static void main(String[] args) throws Exception {
if (isUseSharedSpacesDisabled()) {
throw new SkippedException("Skipped -- This test is not applicable when JTREG tests are executed with -Xshare:off, or if the JDK doesn't have a default archive.");
}
if (args.length != 1 || (!args[0].equals("verifySharedSpacesOff") && !args[0].equals("verifySharedSpacesOn"))) {
throw new RuntimeException("Must run with verifySharedSpacesOff or verifySharedSpacesOn");
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ static void doTest() throws Exception {
static void doTest(boolean errorInDump) throws Exception {
for (int i = 1; i <= 3; i++) {
System.out.println("========================================");
System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader + ", case: " + i);
System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader + ", useZGC: " + useZGC + ", case: " + i);
System.out.println("========================================");
String topArchiveName = getNewArchiveName();
String testCase = Integer.toString(i);
@@ -148,6 +148,7 @@ static void doTest(boolean errorInDump) throws Exception {
cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
"-XX:+UseZGC", "-XX:ZCollectionInterval=0.01",
loaderMainClass, appJar);
setBaseArchiveOptions("-XX:+UseZGC", "-Xlog:cds");
} else {
cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
loaderMainClass, appJar);