From 10b97e2ed3033b4693d881ec90631d4ce8735b5d Mon Sep 17 00:00:00 2001 From: Josh Elser Date: Thu, 24 Aug 2017 17:52:13 -0400 Subject: [PATCH] HBASE-18679 Add a null check around the result of getCounters() in ITBLL --- .../hadoop/hbase/test/IntegrationTestBigLinkedList.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index 2fdfab629e..f05ef6669b 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -820,6 +820,11 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { public boolean verify() { try { Counters counters = job.getCounters(); + if (counters == null) { + LOG.info("Counters object was null, Generator verification cannot be performed." + + " This is commonly a result of insufficient YARN configuration."); + return false; + } if (counters.findCounter(Counts.TERMINATING).getValue() > 0 || counters.findCounter(Counts.UNDEFINED).getValue() > 0 || @@ -1315,7 +1320,8 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { if (success) { Counters counters = job.getCounters(); if (null == counters) { - LOG.warn("Counters were null, cannot verify Job completion"); + LOG.warn("Counters were null, cannot verify Job completion." + + " This is commonly a result of insufficient YARN configuration."); // We don't have access to the counters to know if we have "bad" counts return 0; } @@ -1337,6 +1343,11 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { } Counters counters = job.getCounters(); + if (counters == null) { + LOG.info("Counters object was null, write verification cannot be performed." + + " This is commonly a result of insufficient YARN configuration."); + return false; + } // Run through each check, even if we fail one early boolean success = verifyExpectedValues(expectedReferenced, counters); -- 2.13.3