mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #16422 from ClickHouse/tavplubix-patch-1
Fix printing of stacktraces in clickhouse-test
This commit is contained in:
commit
e5cb383c69
@ -180,7 +180,7 @@ def need_retry(stderr):
|
||||
|
||||
def get_processlist(client_cmd):
|
||||
try:
|
||||
return subprocess.check_output("{} --query 'SHOW PROCESSLIST FORMAT Vertical'".format(client_cmd), shell=True)
|
||||
return subprocess.check_output("{} --query 'SHOW PROCESSLIST FORMAT Vertical'".format(client_cmd), shell=True).decode('utf-8')
|
||||
except:
|
||||
return "" # server seems dead
|
||||
|
||||
@ -189,7 +189,7 @@ def get_processlist(client_cmd):
|
||||
def get_stacktraces_from_gdb(server_pid):
|
||||
cmd = "gdb -batch -ex 'thread apply all backtrace' -p {}".format(server_pid)
|
||||
try:
|
||||
return subprocess.check_output(cmd, shell=True)
|
||||
return subprocess.check_output(cmd, shell=True).decode('utf-8')
|
||||
except Exception as ex:
|
||||
return "Error occured while receiving stack traces from gdb: {}".format(str(ex))
|
||||
|
||||
@ -198,7 +198,10 @@ def get_stacktraces_from_gdb(server_pid):
|
||||
# it does not work in Sandbox
|
||||
def get_stacktraces_from_clickhouse(client):
|
||||
try:
|
||||
return subprocess.check_output("{} --allow_introspection_functions=1 --query \"SELECT arrayStringConcat(arrayMap(x, y -> concat(x, ': ', y), arrayMap(x -> addressToLine(x), trace), arrayMap(x -> demangle(addressToSymbol(x)), trace)), '\n') as trace FROM system.stack_trace format Vertical\"".format(client), shell=True)
|
||||
return subprocess.check_output("{} --allow_introspection_functions=1 --query "
|
||||
"\"SELECT arrayStringConcat(arrayMap(x, y -> concat(x, ': ', y), arrayMap(x -> addressToLine(x), trace), "
|
||||
"arrayMap(x -> demangle(addressToSymbol(x)), trace)), '\n') as trace "
|
||||
"FROM system.stack_trace format Vertical\"".format(client), shell=True).decode('utf-8')
|
||||
except Exception as ex:
|
||||
return "Error occured while receiving stack traces from client: {}".format(str(ex))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user