代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-21 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Subject: Backport JDK-8207908 JMXStatusTest.java fails assertion intermittently
---
.../management/jmxremote/startstop/JMXStatusTest.java | 5 ++---
.../jmxremote/startstop/ManagementAgentJcmd.java | 10 +++++-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java
index 1e6259ef0..fc1b48832 100644
--- a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java
+++ b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -88,8 +88,6 @@ abstract public class JMXStatusTest {
args.addAll(getCustomVmArgs());
args.add(TEST_APP_NAME);
testAppPb = ProcessTools.createTestJavaProcessBuilder(args);
-
- jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false);
}
@BeforeMethod
@@ -98,6 +96,7 @@ abstract public class JMXStatusTest {
TEST_APP_NAME, testAppPb,
(Predicate<String>)l->l.trim().equals("main enter")
);
+ jcmd = new ManagementAgentJcmd(testApp, false);
}
@AfterMethod
diff --git a/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java b/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java
index 0781bc941..7135f6ea2 100644
--- a/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java
+++ b/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, 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
@@ -47,11 +47,11 @@ final class ManagementAgentJcmd {
private static final String CMD_STATUS = "ManagementAgent.status";
private static final String CMD_PRINTPERF = "PerfCounter.print";
- private final String id;
+ private final long pid;
private final boolean verbose;
- public ManagementAgentJcmd(String targetApp, boolean verbose) {
- this.id = targetApp;
+ public ManagementAgentJcmd(Process targetApp, boolean verbose) {
+ this.pid = targetApp.pid();
this.verbose = verbose;
}
@@ -174,7 +174,7 @@ final class ManagementAgentJcmd {
* @throws InterruptedException
*/
private String jcmd(Consumer<String> c, String ... command) throws IOException, InterruptedException {
- return jcmd(id, c, command);
+ return jcmd(Long.toString(pid), c, command);
}
/**
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。