Updated Branches: refs/heads/trunk 0dba90a42 -> 8759c3b15
FLUME-1524. Fix flaky MonitoredCounterGroup test. (Mike Percy via Hari Shreedharan) Project: http://git-wip-us.apache.org/repos/asf/flume/repo Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/8759c3b1 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/8759c3b1 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/8759c3b1 Branch: refs/heads/trunk Commit: 8759c3b1533bf676f289fbb8a2bacb73deb19ff5 Parents: 0dba90a Author: Hari Shreedharan <[email protected]> Authored: Wed Aug 29 15:08:47 2012 -0700 Committer: Hari Shreedharan <[email protected]> Committed: Wed Aug 29 15:08:47 2012 -0700 ---------------------------------------------------------------------- .../instrumentation/TestMonitoredCounterGroup.java | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flume/blob/8759c3b1/flume-ng-core/src/test/java/org/apache/flume/instrumentation/TestMonitoredCounterGroup.java ---------------------------------------------------------------------- diff --git a/flume-ng-core/src/test/java/org/apache/flume/instrumentation/TestMonitoredCounterGroup.java b/flume-ng-core/src/test/java/org/apache/flume/instrumentation/TestMonitoredCounterGroup.java index 1b8447a..0a730e9 100644 --- a/flume-ng-core/src/test/java/org/apache/flume/instrumentation/TestMonitoredCounterGroup.java +++ b/flume-ng-core/src/test/java/org/apache/flume/instrumentation/TestMonitoredCounterGroup.java @@ -157,6 +157,9 @@ public class TestMonitoredCounterGroup { assertSkCounterState(on, connCreated, connClosed, connFailed, batchEmpty, batchUnderflow, batchComplete, eventDrainAttempt, eventDrainSuccess); + // give start time a chance to increment + Thread.sleep(5L); + skc.start(); Assert.assertTrue("StartTime", getStartTime(on) != 0L); Assert.assertTrue("StartTime", getStartTime(on) > start1); @@ -219,6 +222,9 @@ public class TestMonitoredCounterGroup { assertChCounterState(on, numChannelSize, numEventPutAttempt, numEventTakeAttempt, numEventPutSuccess, numEventTakeSuccess); + // give start time a chance to increment + Thread.sleep(5L); + chc.start(); Assert.assertTrue("StartTime", getStartTime(on) != 0L); Assert.assertTrue("StartTime", getStartTime(on) > start1); @@ -280,6 +286,9 @@ public class TestMonitoredCounterGroup { numAppendReceived, numAppendAccepted, numAppendBatchReceived, numAppendBatchAccepted); + // give start time a chance to increment + Thread.sleep(5L); + srcc.start(); Assert.assertTrue("StartTime", getStartTime(on) != 0L); Assert.assertTrue("StartTime", getStartTime(on) > start1);
