Description
We use Stats.export in several places to have closures that export a variable, which can be flaky with our code coverage analysis task. If SchedulerIT is not running long enough for a stat sample to take place, these classes will be missed. In reality, these classes should be considered lacking test coverage if they are only lit up during a stat sample in SchedulerIT.
Currently-affected code sites:
$ grep -R 'Stats.export(new StatImpl' src/main/java/ src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java: Stats.export(new StatImpl<Long>("reservation_cache_size") { src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java: Stats.export(new StatImpl<Long>("async_tasks_completed") { src/main/java/org/apache/aurora/scheduler/storage/mem/MemStorage.java: Stats.export(new StatImpl<Integer>("storage_lock_threads_waiting") { src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java: Stats.export(new StatImpl<Integer>("framework_registered") { src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java: Stats.export(new StatImpl<Integer>("scheduler_lifecycle_" + state) {