You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2019/11/15 18:03:36 UTC

[impala] branch master updated: IMPALA-8906: Fix flaky profile observability test

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 96394b4  IMPALA-8906: Fix flaky profile observability test
96394b4 is described below

commit 96394b4e3f653139d0a9a36e34122528fae6dcde
Author: Tamas Mate <tm...@cloudera.com>
AuthorDate: Wed Nov 13 10:08:30 2019 +0100

    IMPALA-8906: Fix flaky profile observability test
    
    The test_query_profile_contains_query_compilation_metadata_load_events
    is flaky because only non-zero stats are printed and the test is not
    prepared to handle lines appearing based on conditions.
    
    In general, zero values are printed in the profile as well, this makes
    profile parsing simpler. Therefore, instead of changing the test the
    condition has been removed as part of this change and the test is
    updated accordingly.
    
    Change-Id: I7f6172d75294c1dea8f6be086ebb303725c92620
    Reviewed-on: http://gerrit.cloudera.org:8080/14704
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Csaba Ringhofer <cs...@cloudera.com>
---
 .../org/apache/impala/catalog/local/CatalogdMetaProvider.java    | 8 ++------
 .../apache/impala/catalog/local/CatalogdMetaProviderTest.java    | 8 +++++---
 tests/query_test/test_observability.py                           | 9 +++++++--
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/catalog/local/CatalogdMetaProvider.java b/fe/src/main/java/org/apache/impala/catalog/local/CatalogdMetaProvider.java
index fd05ee5..f638408 100644
--- a/fe/src/main/java/org/apache/impala/catalog/local/CatalogdMetaProvider.java
+++ b/fe/src/main/java/org/apache/impala/catalog/local/CatalogdMetaProvider.java
@@ -551,12 +551,8 @@ public class CatalogdMetaProvider implements MetaProvider {
     profile.addToCounter(prefix + "Requests", TUnit.NONE, numHits + numMisses);
     profile.addToCounter(prefix + "Time", TUnit.TIME_MS,
         stopwatch.elapsed(TimeUnit.MILLISECONDS));
-    if (numHits > 0) {
-      profile.addToCounter(prefix + "Hits", TUnit.NONE, numHits);
-    }
-    if (numMisses > 0) {
-      profile.addToCounter(prefix + "Misses", TUnit.NONE, numMisses);
-    }
+    profile.addToCounter(prefix + "Hits", TUnit.NONE, numHits);
+    profile.addToCounter(prefix + "Misses", TUnit.NONE, numMisses);
   }
 
   /**
diff --git a/fe/src/test/java/org/apache/impala/catalog/local/CatalogdMetaProviderTest.java b/fe/src/test/java/org/apache/impala/catalog/local/CatalogdMetaProviderTest.java
index c4276d2..dcc922a 100644
--- a/fe/src/test/java/org/apache/impala/catalog/local/CatalogdMetaProviderTest.java
+++ b/fe/src/test/java/org/apache/impala/catalog/local/CatalogdMetaProviderTest.java
@@ -242,13 +242,15 @@ public class CatalogdMetaProviderTest {
       profile = FrontendProfile.getCurrent();
     }
     TRuntimeProfileNode prof = profile.emitAsThrift();
-    assertEquals(3, prof.counters.size());
+    assertEquals(4, prof.counters.size());
     Collections.sort(prof.counters);
     assertEquals("TCounter(name:CatalogFetch.Tables.Hits, unit:NONE, value:1)",
         prof.counters.get(0).toString());
-    assertEquals("TCounter(name:CatalogFetch.Tables.Requests, unit:NONE, value:1)",
+    assertEquals("TCounter(name:CatalogFetch.Tables.Misses, unit:NONE, value:0)",
         prof.counters.get(1).toString());
-    assertEquals("CatalogFetch.Tables.Time", prof.counters.get(2).name);
+    assertEquals("TCounter(name:CatalogFetch.Tables.Requests, unit:NONE, value:1)",
+        prof.counters.get(2).toString());
+    assertEquals("CatalogFetch.Tables.Time", prof.counters.get(3).name);
   }
 
   @Test
diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py
index 81840ca..9087852 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -311,16 +311,19 @@ class TestObservability(ImpalaTestSuite):
     else:
       load_event_regexes = [
         r'Frontend:',
+        r'CatalogFetch.ColumnStats.Hits',
         r'CatalogFetch.ColumnStats.Misses',
         r'CatalogFetch.ColumnStats.Requests',
         r'CatalogFetch.ColumnStats.Time',
-        # The value of this counter may or not be present if it has a value of zero
-        r'CatalogFetch.Config.Misses|CatalogFetch.Config.Hits',
+        r'CatalogFetch.Config.Hits',
+        r'CatalogFetch.Config.Misses',
         r'CatalogFetch.Config.Requests',
         r'CatalogFetch.Config.Time',
         r'CatalogFetch.DatabaseList.Hits',
+        r'CatalogFetch.DatabaseList.Misses',
         r'CatalogFetch.DatabaseList.Requests',
         r'CatalogFetch.DatabaseList.Time',
+        r'CatalogFetch.PartitionLists.Hits',
         r'CatalogFetch.PartitionLists.Misses',
         r'CatalogFetch.PartitionLists.Requests',
         r'CatalogFetch.PartitionLists.Time',
@@ -333,8 +336,10 @@ class TestObservability(ImpalaTestSuite):
         r'CatalogFetch.RPCs.Time',
         r'CatalogFetch.StorageLoad.Time',
         r'CatalogFetch.TableNames.Hits',
+        r'CatalogFetch.TableNames.Misses',
         r'CatalogFetch.TableNames.Requests',
         r'CatalogFetch.TableNames.Time',
+        r'CatalogFetch.Tables.Hits',
         r'CatalogFetch.Tables.Misses',
         r'CatalogFetch.Tables.Requests',
         r'CatalogFetch.Tables.Time']