This is an automated email from the ASF dual-hosted git repository. hashutosh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push: new e48a682 HIVE-23322 : Update some tests to better tolerate a more busy environment (Zoltan Haindrich via Ashutosh Chauhan) e48a682 is described below commit e48a6827dc78c38b282b590e95152cdabdd79d85 Author: Zoltan Haindrich <k...@rxd.hu> AuthorDate: Sun May 3 01:00:06 2020 -0700 HIVE-23322 : Update some tests to better tolerate a more busy environment (Zoltan Haindrich via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan <hashut...@apache.org> --- .../hive/common/metrics/metrics2/TestCodahaleMetrics.java | 7 ++++++- .../hive/llap/tezplugins/TestLlapTaskCommunicator.java | 4 ++-- .../hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java | 15 +++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/common/src/test/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleMetrics.java b/common/src/test/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleMetrics.java index 1c49d95..9c4e475 100644 --- a/common/src/test/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleMetrics.java +++ b/common/src/test/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleMetrics.java @@ -154,7 +154,12 @@ public class TestCodahaleMetrics { public void testFileReporting() throws Exception { int runs = 5; String counterName = "count2"; - for (int i = 0; i < runs; i++) { + + // on the first write the metrics writer should initialize stuff + MetricsFactory.getInstance().incrementCounter(counterName); + sleep(5 * REPORT_INTERVAL_MS); + + for (int i = 1; i <= runs; i++) { MetricsFactory.getInstance().incrementCounter(counterName); sleep(REPORT_INTERVAL_MS + REPORT_INTERVAL_MS / 2); Assert.assertEquals(i + 1, getCounterValue(counterName)); diff --git a/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java b/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java index 9b4ac27..3bbbdf3 100644 --- a/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java +++ b/llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java @@ -66,7 +66,7 @@ import org.mockito.stubbing.Answer; public class TestLlapTaskCommunicator { - @Test (timeout = 5000) + @Test (timeout = 30000) public void testEntityTracker1() { LlapTaskCommunicator.EntityTracker entityTracker = new LlapTaskCommunicator.EntityTracker(); @@ -121,7 +121,7 @@ public class TestLlapTaskCommunicator { } - @Test(timeout = 5000) + @Test(timeout = 30000) public void testFinishableStateUpdateFailure() throws Exception { LlapTaskCommunicatorWrapperForTest wrapper = null; diff --git a/ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java b/ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java index 0d39999..fbf2b8b 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/parse/TestSQL11ReservedKeyWordsNegative.java @@ -25,7 +25,6 @@ import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.Context; import org.apache.hadoop.hive.ql.session.SessionState; import org.junit.Assert; -import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,11 +40,6 @@ public class TestSQL11ReservedKeyWordsNegative { private static HiveConf conf = new HiveConf(SemanticAnalyzer.class); private static ParseDriver pd = new ParseDriver(); - @BeforeClass - public static void initialize() { - SessionState.start(conf); - } - private static ASTNode parse(String query) throws ParseException { ASTNode nd = null; try { @@ -57,6 +51,11 @@ public class TestSQL11ReservedKeyWordsNegative { } public static class TestSQL11ReservedKeyWordsNegativeMisc { + @BeforeClass + public static void initialize() { + SessionState.start(conf); + } + @Test public void testSQL11ReservedKeyWords_KILL() { try { @@ -72,6 +71,10 @@ public class TestSQL11ReservedKeyWordsNegative { @RunWith(Parameterized.class) public static class TestSQL11ReservedKeyWordsNegativeParametrized { + @BeforeClass + public static void initialize() { + SessionState.start(conf); + } @Parameters(name = "{0}") public static Collection<String[]> data() {