diff --git a/bzETL/bz_etl.py b/bzETL/bz_etl.py index 54e3e48..b9295e6 100644 --- a/bzETL/bz_etl.py +++ b/bzETL/bz_etl.py @@ -183,7 +183,9 @@ def incremental_etl(settings, param, db, es, es_comments, output_queue): private_bugs = get_private_bugs(db, param) es.delete_record({"terms": {"bug_id": private_bugs}}) es_comments.delete_record({"terms": {"bug_id": private_bugs}}) - Log.note("Ensure the following private bugs are deleted:\n{{private_bugs}}", {"private_bugs": private_bugs}) + + still_existing = get_bug_ids(es, {"terms":{"bug_id":private_bugs}}) + Log.note("Ensure the following private bugs are deleted:\n{{private_bugs}}", {"private_bugs": still_existing}) #RECENT PUBLIC BUGS possible_public_bugs = get_recent_private_bugs(db, param) @@ -400,6 +402,27 @@ def main(settings, es=None, es_comments=None): except Exception, e: pass +def get_bug_ids(es, filter): + try: + results = es.search({ + "query": {"filtered": { + "query": {"match_all": {}}, + "filter": filter + }}, + "from": 0, + "size": 200000, + "sort": [], + "fields": ["bug_id"] + }) + + return results.hits.fields.bug_id + except Exception, e: + Log.error("Can not get_max_bug from {{host}}/{{index}}", { + "host": es.settings.host, + "index": es.settings.index + }, e) + + def get_max_bug_id(es): try: diff --git a/tests/resources/python/leak_check.py b/tests/resources/python/leak_check.py index 48c9687..f2d815b 100644 --- a/tests/resources/python/leak_check.py +++ b/tests/resources/python/leak_check.py @@ -279,10 +279,18 @@ def main(): finally: pass -def error(): +def error(results): settings = startup.read_settings() + + content = [] + for e in results.errors: + content.append("FAIL: "+str(e[0]._testMethodName)) + for f in results.failures: + content.append("FAIL: "+str(f[0]._testMethodName)) + + Emailer(settings.email).send_email( - text_data = "The BZ ETL leak checker seems to have found leaks! Shutdown access to public cluster now!" + text_data = "\n".join(content) )