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:
Dmitrij Pochepko 2015-01-16 20:59:23 +04:00
parent 0520df8a92
commit 427f25366e
2 changed files with 10 additions and 6 deletions

View file

@ -98,11 +98,13 @@ public class PoolsIndependenceTest implements NotificationListener {
return false; return false;
}); });
for (BlobType bt : BlobType.getAvailable()) { for (BlobType bt : BlobType.getAvailable()) {
int expectedNotificationsAmount = bt.equals(btype) ? 1 : 0; if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
Asserts.assertEQ(counters.get(bt.getMemoryPool().getName()).get(), int expectedNotificationsAmount = bt.equals(btype) ? 1 : 0;
expectedNotificationsAmount, String.format("Unexpected " Asserts.assertEQ(counters.get(bt.getMemoryPool().getName()).get(),
+ "amount of notifications for pool: %s", expectedNotificationsAmount, String.format("Unexpected "
bt.getMemoryPool().getName())); + "amount of notifications for pool: %s",
bt.getMemoryPool().getName()));
}
} }
try { try {
((NotificationEmitter) ManagementFactory.getMemoryMXBean()). ((NotificationEmitter) ManagementFactory.getMemoryMXBean()).

View file

@ -52,7 +52,9 @@ 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()) {
new ThresholdNotificationsTest(bt).runTest(); if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
new ThresholdNotificationsTest(bt).runTest();
}
} }
} }