Skip to content
Permalink
Browse files
8279970: two AppCDS tests fail after JDK-8261455
Reviewed-by: ccheung, iklam
  • Loading branch information
yminqi committed Jan 19, 2022
1 parent 4eb4f94 commit b0496b0df60cf19a0666f1f1c382f7bcd01e15bb
Showing 4 changed files with 14 additions and 6 deletions.
@@ -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);

1 comment on commit b0496b0

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on b0496b0 Jan 19, 2022

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.