mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8068385: [TESTBUG] hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java sometimes fails(unstable behaviour)
Fixing unstable behaviour of 2 tests Reviewed-by: iignatyev
This commit is contained in:
parent
0520df8a92
commit
427f25366e
2 changed files with 10 additions and 6 deletions
|
@ -98,12 +98,14 @@ public class PoolsIndependenceTest implements NotificationListener {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
for (BlobType bt : BlobType.getAvailable()) {
|
for (BlobType bt : BlobType.getAvailable()) {
|
||||||
|
if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
|
||||||
int expectedNotificationsAmount = bt.equals(btype) ? 1 : 0;
|
int expectedNotificationsAmount = bt.equals(btype) ? 1 : 0;
|
||||||
Asserts.assertEQ(counters.get(bt.getMemoryPool().getName()).get(),
|
Asserts.assertEQ(counters.get(bt.getMemoryPool().getName()).get(),
|
||||||
expectedNotificationsAmount, String.format("Unexpected "
|
expectedNotificationsAmount, String.format("Unexpected "
|
||||||
+ "amount of notifications for pool: %s",
|
+ "amount of notifications for pool: %s",
|
||||||
bt.getMemoryPool().getName()));
|
bt.getMemoryPool().getName()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
|
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
|
||||||
removeNotificationListener(this);
|
removeNotificationListener(this);
|
||||||
|
|
|
@ -52,9 +52,11 @@ public class ThresholdNotificationsTest implements NotificationListener {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
for (BlobType bt : BlobType.getAvailable()) {
|
for (BlobType bt : BlobType.getAvailable()) {
|
||||||
|
if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
|
||||||
new ThresholdNotificationsTest(bt).runTest();
|
new ThresholdNotificationsTest(bt).runTest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ThresholdNotificationsTest(BlobType btype) {
|
public ThresholdNotificationsTest(BlobType btype) {
|
||||||
this.btype = btype;
|
this.btype = btype;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue