tests/stress: add core dumps into artifacts

gcore is used here because:

- default kernel.core_pattern is "|/usr/share/apport/apport %p %s %c %d %P %E" [1]
  and so to make it work you need to install apport into container and
  configure it propertly -- to complex

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/33389/204e459d259570e6bc7fe2903f7e516094a916ca/stress_test__address__actions_/runlog.log

- kernel.core_pattern cannot be changed, since proc is mounted in
  read-only mode in non --privileged containers [2]

  [2]: https://s3.amazonaws.com/clickhouse-test-reports/33389/dab3afbd94558f9654bf0aa1e06e06e2962f3bb0/stress_test__address__actions_/runlog.log

v2: change kernel.core_pattern
v3: use gcore, since you are not allowed to change kernel.core_pattern
    in container (only under --privileged)
This commit is contained in:
Azat Khuzhin 2022-01-04 14:03:40 +03:00
parent 6af46979a8
commit ebed6193b4

View File

@ -146,6 +146,7 @@ handle SIGUSR2 nostop noprint pass
handle SIG$RTMIN nostop noprint pass
info signals
continue
gcore
backtrace full
info locals
info registers
@ -263,3 +264,10 @@ done
# Write check result into check_status.tsv
clickhouse-local --structure "test String, res String" -q "SELECT 'failure', test FROM table WHERE res != 'OK' order by (lower(test) like '%hung%') LIMIT 1" < /test_output/test_results.tsv > /test_output/check_status.tsv
[ -s /test_output/check_status.tsv ] || echo -e "success\tNo errors found" > /test_output/check_status.tsv
# Core dumps (see gcore)
# Default filename is 'core.PROCESS_ID'
for core in core.*; do
pigz $core
mv $core.gz /output/
done