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
|
||||
@@ -103,9 +103,13 @@ jobs:
|
||||
- name: Compilazione (avvisi = errori)
|
||||
run: dotnet build Febe.slnx -c Release -nologo -warnaserror
|
||||
|
||||
# As in the verification: twenty minutes without a test that starts or ends (the longest take 2 to 3) end the
|
||||
# run and name the tests in progress, instead of a job that waits for the runner's own limit; no dump: one of
|
||||
# the test host, with its managed heap, can take gigabytes in the febe-ci package.
|
||||
- name: Prove
|
||||
run: >-
|
||||
dotnet test tests/Febe.Tests -c Release --no-build --nologo
|
||||
--blame-hang-timeout 20m --blame-hang-dump-type none
|
||||
--logger "trx;LogFileName=prove.trx" --results-directory out/prove
|
||||
|
||||
# No skipped test: an inconclusive test (for example without Chromium) stops the release.
|
||||
|
||||
@@ -174,10 +174,17 @@ jobs:
|
||||
- name: Compilazione di tutta la soluzione (avvisi = errori)
|
||||
run: dotnet build Febe.slnx -c Release -nologo -warnaserror
|
||||
|
||||
# Twenty minutes without a test that starts or ends (the longest take 2 to 3) end the run and name the tests in
|
||||
# progress, instead of a job that waits for the runner's own limit; no dump: one of the test host, with its
|
||||
# managed heap, can take gigabytes in the febe-ci package.
|
||||
- name: Prove, seme 13
|
||||
run: >-
|
||||
dotnet test tests/Febe.Tests -c Release --no-build --nologo
|
||||
--logger "trx;LogFileName=prove-seme-13.trx" --results-directory out/prove
|
||||
run: |
|
||||
bash .gitea/scripts/macchina.sh out/prove/macchina.log &
|
||||
macchina=$!
|
||||
trap 'kill "$macchina" 2> /dev/null || true' EXIT
|
||||
dotnet test tests/Febe.Tests -c Release --no-build --nologo \
|
||||
--blame-hang-timeout 20m --blame-hang-dump-type none \
|
||||
--logger "trx;LogFileName=prove-seme-13.trx" --results-directory out/prove
|
||||
|
||||
- name: Prove del sito di prova, seme dell'esecuzione
|
||||
if: ${{ !cancelled() && steps.semi.outputs.seme != '' }}
|
||||
@@ -185,6 +192,7 @@ jobs:
|
||||
FEBE_SEME_PROVA: ${{ steps.semi.outputs.seme }}
|
||||
run: >-
|
||||
dotnet test tests/Febe.Tests -c Release --no-build --nologo --filter "TestCategory=SitoDiProva"
|
||||
--blame-hang-timeout 20m --blame-hang-dump-type none
|
||||
--logger "trx;LogFileName=prove-seme-$FEBE_SEME_PROVA.trx" --results-directory out/prove
|
||||
|
||||
- name: Riepilogo delle prove
|
||||
@@ -201,6 +209,7 @@ jobs:
|
||||
shopt -s nullglob
|
||||
risultati=(out/prove/*.trx)
|
||||
((${#risultati[@]} > 0)) || { echo "::warning::Nessun risultato delle prove da conservare."; exit 0; }
|
||||
[ ! -f out/prove/macchina.log ] || risultati+=(out/prove/macchina.log)
|
||||
bash .gitea/scripts/artefatti.sh verifica "${risultati[@]}"
|
||||
|
||||
installatore:
|
||||
|
||||
Reference in new issue
Block a user