Cirrus-CI: add some timing info on pkg install failure

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 77013d11e6)
This commit is contained in:
Ed Maste 2021-06-02 13:08:29 -04:00
parent df9ad08cb4
commit b00e7ce403
1 changed files with 9 additions and 2 deletions

View File

@ -1,10 +1,11 @@
#!/bin/sh
set -e
start_time=$(date +%s)
pkg install -y "$@" && exit 0
cat <<EOF
pkg install failed
pkg install failed after $(($(date +%s) - $start_time))s
dmesg tail:
$(dmesg | tail)
@ -12,4 +13,10 @@ $(dmesg | tail)
trying again
EOF
pkg install -y "$@"
start_time=$(date +%s)
pkg install -y "$@" && exit 0
cat <<EOF
second pkg install failed after $(($(date +%s) - $start_time))s
EOF
exit 1