The HeapMetricTest sometimes fails due to missing transitions. To ensure that we see the transitions we expect I propose to change the tests synchronization slightly and also wait for two updates each time. Otherwise we might be number that only correspond to part of the allocation/deallocation we expect to see.