CI: le prove ferme si chiudono da sole e si vede lo stato della macchina
Le esecuzioni 502 e 532 si sono fermate per circa mezz'ora con tutte le prove in corso, anche quelle H.265 che non usano browser: i Chromium paralleli non sono la causa, quindi nessun limite. Ogni dotnet test ha ora --blame-hang-timeout 20m senza dump, e durante le prove .gitea/scripts/macchina.sh scrive carico, memoria, scambio e pressione in macchina.log, caricato con i .trx: alla prossima pausa si vedrà se la macchina del runner era sospesa o che cosa le mancava. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d66cf96d3
commit
50f5c8150a
7 files changed
+105
-4
No files matched your search
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# The state of the machine while the tests run: every few seconds one line with the time, the load and the available
|
||||
# memory and swap of the runner host and, where the kernel offers them, its CPU, memory and disk pressure (PSI). Runs
|
||||
# 502 and 532 stopped for half an hour with every test in progress, browser or not: a hole in the times of this file
|
||||
# says the host (or the container) was suspended, lines without holes say what it was short of.
|
||||
#
|
||||
# .gitea/scripts/macchina.sh <file> [secondi fra una riga e l'altra] [righe, 0 = senza fine]
|
||||
#
|
||||
# It runs in the background of the test step, which ends it. Only numbers of the machine: no names, paths or tokens.
|
||||
set -euo pipefail
|
||||
|
||||
file="${1:?Indica il file da scrivere.}"
|
||||
ogni="${2:-15}"
|
||||
righe="${3:-0}"
|
||||
[[ "$ogni" =~ ^[0-9]+$ && "$righe" =~ ^[0-9]+$ ]] || { echo "I secondi e le righe devono essere numeri interi." >&2; exit 2; }
|
||||
mkdir -p "$(dirname "$file")"
|
||||
|
||||
# One value of /proc/meminfo, in MB; nothing where there is no /proc.
|
||||
memoria() {
|
||||
awk -v nome="$1:" '$1 == nome { printf "%d", $2 / 1024 }' /proc/meminfo 2> /dev/null || true
|
||||
}
|
||||
|
||||
# The ten-second average of the «some» line of one PSI file; nothing where the kernel does not offer it.
|
||||
pressione() {
|
||||
awk '$1 == "some" { sub(/^avg10=/, "", $2); printf "%s", $2 }' "/proc/pressure/$1" 2> /dev/null || true
|
||||
}
|
||||
|
||||
fatte=0
|
||||
while :; do
|
||||
carico=$(cut -d ' ' -f 1-3 /proc/loadavg 2> /dev/null || true)
|
||||
printf '%s carico=%s memoria=%s MB scambio=%s MB psi cpu=%s memoria=%s disco=%s\n' \
|
||||
"$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$carico" "$(memoria MemAvailable)" "$(memoria SwapFree)" \
|
||||
"$(pressione cpu)" "$(pressione memory)" "$(pressione io)" >> "$file"
|
||||
fatte=$((fatte + 1))
|
||||
if ((righe > 0 && fatte >= righe)); then
|
||||
break
|
||||
fi
|
||||
# With no share in the output of the step: killing the script must not leave the step waiting for this sleep.
|
||||
sleep "$ogni" > /dev/null 2>&1
|
||||
done
|
||||
Reference in new issue
Block a user