From a8694f804a3e49602bee046cc831aadfbfc41cee Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Thu, 17 Jan 2019 17:15:19 -0500 Subject: [PATCH] Log a warning if uncategorized_fails finds nothing Chances are probably 0 that we won't have failures or that we'd have 100% categorization rates, which probably mean if we don't get any failures the default ALL_FAILS_QUERY is broken, which can easily happen: I208675c2258b6c635925c7b9ea9fae5afd000565 This logs a warning if a group yields no failures based on the default ALL_FAILS_QUERY. Change-Id: Ib2c12b1fc276389297cf4ac15775e6b2da828fdd --- elastic_recheck/cmd/uncategorized_fails.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elastic_recheck/cmd/uncategorized_fails.py b/elastic_recheck/cmd/uncategorized_fails.py index 07d0d671..4d339c67 100755 --- a/elastic_recheck/cmd/uncategorized_fails.py +++ b/elastic_recheck/cmd/uncategorized_fails.py @@ -363,6 +363,12 @@ def main(): LOG.info("Processing failures for group: %s", group) fails = all_gate_fails[group] if not fails: + # It would be pretty spectacular if we had no failures so if we're + # using the default all failures query, there could be a problem + # with the query, so log a hint. + if opts.all_fails_query == er_config.ALL_FAILS_QUERY: + LOG.warning('No failures found in group "%s". The default ' + 'ALL_FAILS_QUERY might be broken.', group) continue data = collect_metrics(classifier, fails, config=config) engine = setup_template_engine(opts.templatedir, group=group)