Clock.sleep(2000);
LogicalNode coll = setupColl(12345, "coll", "count");
LogicalNode coll2 = setupColl(12346, "coll2", "count2");
// wait until the counts add up properly
AccumulatorSink ctr = (AccumulatorSink) ReportManager.get().getReportable(
"count");
AccumulatorSink ctr2 = (AccumulatorSink) ReportManager.get().getReportable(
"count2");
loopUntilCount(count, coll, coll2);
// close off the collector
Driver c1driver = coll.getDriver();
Driver c2driver = coll2.getDriver();
coll.close();
coll2.close();
// dump info for debugging
Map<String, ReportEvent> rpts = new HashMap<String, ReportEvent>();
agent.getReports(rpts);
for (Entry<String, ReportEvent> e : rpts.entrySet()) {
LOG.info(e.getKey() + " : " + e.getValue());
}
// check the end states
assertEquals(count, ctr.getCount() + ctr2.getCount());
assertTrue(ctr.getCount() > 0);
assertTrue(ctr2.getCount() > 0);
// the collector can be in ERROR or IDLE state because of the randomness.
assertTrue("c1 failed to get to in IDLE state",
c1driver.waitForAtLeastState(DriverState.IDLE, 1000));
assertTrue("c2 failed to get to in IDLE state",