Assert.assertEquals(100L, Longs.fromByteArray(mydataset.read("title:title".getBytes(Charsets.UTF_8))));
RuntimeMetrics procedureMetrics = RuntimeStats.getProcedureMetrics("WordCountApp", "WordFrequency");
procedureMetrics.waitForProcessed(1, 1, TimeUnit.SECONDS);
Assert.assertEquals(0L, procedureMetrics.getException());
MapReduceManager mrManager = applicationManager.startMapReduce("countTotal");
<BUG>mrManager.waitForFinish(15L, TimeUnit.SECONDS);
</BUG>
long totalCount = Long.valueOf(procedureClient.query("total", Collections.<String, String>emptyMap()));
Assert.assertEquals(5 * 100L, totalCount);
} finally {

Assert.assertEquals(100L, Longs.fromByteArray(mydataset.read("title:title".getBytes(Charsets.UTF_8))));
RuntimeMetrics procedureMetrics = RuntimeStats.getProcedureMetrics("WordCountApp", "WordFrequency");
procedureMetrics.waitForProcessed(1, 1, TimeUnit.SECONDS);
Assert.assertEquals(0L, procedureMetrics.getException());
MapReduceManager mrManager = applicationManager.startMapReduce("countTotal");
mrManager.waitForFinish(60L, TimeUnit.SECONDS);
long totalCount = Long.valueOf(procedureClient.query("total", Collections.<String, String>emptyMap()));
Assert.assertEquals(5 * 100L, totalCount);
} finally {
