Looking for review and a sponsor. Webrev at http://cr.openjdk.java.net/~jbachorik/7170447/webrev.00
In this issue the timing is the problem. MBeanServer.unregisterMBean() fires the "unregister" notification which is sent to the server asynchronously. Thus it may happen that the "unregister" notification has not been yet processed at the time of invoking removeNotificationListener() and the notification listeners hasn't been cleaned up leading to the test failure. There is no synchronization between the client and the server and such race condition can occur occasionally. Normally, the execution is fast enough to behave like the "unregister" notification is processed synchronously with the unregisterMBean() operation but it seems that using fastdebug Server VM bits with the -Xcomp option strains the CPU enough to make this problem appear. There is no proper fix for this - the only thing that work is waiting a bit longer in the main thread to give the notification processing thread some time to clean up the listeners. Regards, -JB-