From e549a9af3177f6ee83477cde8bd7d0ed72d6ecec Mon Sep 17 00:00:00 2001 From: Sangjin Lee Date: Thu, 14 Jul 2016 15:19:03 -0700 Subject: [PATCH] YARN-5379. TestHBaseTimelineStorage. testWriteApplicationToHBase() fails intermittently (Vrushali C via sjlee) --- .../storage/TestHBaseTimelineStorage.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorage.java index a8de759bce4..e37865fc6d8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorage.java @@ -613,8 +613,8 @@ public class TestHBaseTimelineStorage { TimelineMetric aggMetric = new TimelineMetric(); aggMetric.setId("MEM_USAGE"); Map aggMetricValues = new HashMap(); - ts = System.currentTimeMillis(); - aggMetricValues.put(ts - 120000, 102400000L); + long aggTs = ts; + aggMetricValues.put(aggTs - 120000, 102400000L); aggMetric.setType(Type.SINGLE_VALUE); aggMetric.setRealtimeAggregationOp(TimelineMetricOperation.SUM); aggMetric.setValues(aggMetricValues); @@ -819,9 +819,9 @@ public class TestHBaseTimelineStorage { metric.getValues().get(ts - 20000)); } if (metric.getId().equals("MEM_USAGE")) { - assertTrue(metric.getValues().containsKey(ts - 120000)); - assertEquals(aggMetricValues.get(ts - 120000), - metric.getValues().get(ts - 120000)); + assertTrue(metric.getValues().containsKey(aggTs - 120000)); + assertEquals(aggMetricValues.get(aggTs - 120000), + metric.getValues().get(aggTs - 120000)); } } } finally {