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 2021/02/03 23:21:53 UTC
[impala] 01/02: IMPALA-9588: Add extra logging to cancel tests
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
commit 1a38924d20679ffeb4550766a30b3be56763dc71
Author: Gabor Kaszab <ga...@cloudera.com>
AuthorDate: Wed Jan 27 17:40:53 2021 +0100
IMPALA-9588: Add extra logging to cancel tests
There have been some cancel tests that are flaky and their logs didn't
reveal the root cause of the failures. Adding some extra logging so
that we can see a bit more of the nature of the failure.
The extra log message contains:
- Query SQL
- Message of the exception thrown during fetching the results
- Query Status line from the query profile
Change-Id: Ied7100a9ea2e2f0611cf8e328e589b4c8e5d5100
Reviewed-on: http://gerrit.cloudera.org:8080/16985
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
tests/util/cancel_util.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/util/cancel_util.py b/tests/util/cancel_util.py
index 520f958..7e7bf15 100644
--- a/tests/util/cancel_util.py
+++ b/tests/util/cancel_util.py
@@ -38,7 +38,18 @@ def cancel_query_and_validate_state(client, query, exec_option, table_format,
thread.start()
sleep(cancel_delay)
- assert client.get_state(handle) != client.QUERY_STATES['EXCEPTION']
+ if client.get_state(handle) == client.QUERY_STATES['EXCEPTION']:
+ # If some error occurred before trying to cancel the query then we put an error
+ # message together and fail the test.
+ thread.join()
+ error_msg = "The following query returned an error: %s\n" % query
+ if thread.fetch_results_error is not None:
+ error_msg += str(thread.fetch_results_error) + "\n"
+ profile_lines = client.get_runtime_profile(handle).splitlines()
+ for line in profile_lines:
+ if "Query Status:" in line:
+ error_msg += line
+ assert False, error_msg
cancel_result = client.cancel(handle)
assert cancel_result.status_code == 0,\
'Unexpected status code from cancel request: %s' % cancel_result