8367983: javax/management/monitor/ThreadPoolTest.java and StartStopTest.java fail with Unexpected Maximum Pool Size Overflow!

Reviewed-by: cjplummer, dholmes
This commit is contained in:
Kevin Walls 2025-09-19 08:15:28 +00:00
parent 28879d3d03
commit 930d724923

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
@ -63,6 +63,8 @@ public class StartStopTest {
static int maxPoolSize;
static final AtomicInteger counter = new AtomicInteger();
public static final int TIMEOUT = 2500;
// MBean class
public class ObservedObject implements ObservedObjectMBean {
volatile public boolean called = false;
@ -148,7 +150,7 @@ public class StartStopTest {
for (int i = 0; i < nTasks; i++)
monitor[i].start();
echo(">>> MONITORS started");
doSleep(500);
doSleep(TIMEOUT);
echo(">>> Check FLAGS true");
for (int i = 0; i < nTasks; i++)
if (!monitored[i].called) {
@ -160,7 +162,7 @@ public class StartStopTest {
for (int i = 0; i < nTasks; i++)
monitor[i].stop();
echo(">>> MONITORS stopped");
doSleep(500);
doSleep(TIMEOUT);
echo(">>> Set FLAGS to false");
for (int i = 0; i < nTasks; i++)
monitored[i].called = false;