CI: le prove ferme si chiudono da sole e si vede lo stato della macchina
verifica / controlli (push) Successful in 19s
verifica / prove (push) Successful in 23m17s
verifica / installatore (push) Successful in 2m32s
verifica / immagine (push) Successful in 20m22s

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:
Alby96andClaude Opus 5.5 committed 2026-12-01 14:17:35 +01:00
1 parent 6d66cf96d3
commit 50f5c8150a
7 files changed
+105 -4

No files matched your search

@@ -58,6 +58,37 @@ public sealed partial class PipelineTests
}
}
/// <summary>
/// The state of the machine sampled while the tests run (runs 502 and 532 stopped with every test in progress): the
/// test step starts it, ends it and keeps the result of the tests; the log goes up with the .trx files.
/// </summary>
[TestMethod]
public async Task TheVerificationKeepsTheStateOfTheMachineDuringTheTests()
{
var tests = Code(Workflow("verifica.yml"));
StringAssert.Contains(tests, "bash .gitea/scripts/macchina.sh out/prove/macchina.log &");
StringAssert.Contains(tests, "trap 'kill \"$macchina\" 2> /dev/null || true' EXIT");
StringAssert.Contains(tests, "risultati+=(out/prove/macchina.log)");
CiPath("scripts", "macchina.sh");
var bash = RequireBash();
using var folder = new TempFolder("febe-macchina");
var log = folder.Combine("prove", "macchina.log");
var run = await RunProcessAsync(bash, ["--noprofile", "--norc", ".gitea/scripts/macchina.sh", log.Replace('\\', '/'), "0", "3"]);
Assert.AreEqual(0, run.Code, run.Errors);
var lines = await File.ReadAllLinesAsync(log, TestContext.CancellationToken);
Assert.HasCount(3, lines);
foreach (var line in lines)
{
StringAssert.Matches(line, MachineLine());
}
Assert.AreEqual(2, (await RunProcessAsync(bash, ["--noprofile", "--norc", ".gitea/scripts/macchina.sh", log.Replace('\\', '/'), "presto"])).Code);
}
[System.Text.RegularExpressions.GeneratedRegex(@"^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ carico=[\d. ]* memoria=\d* MB scambio=\d* MB psi cpu=[\d.]* memoria=[\d.]* disco=[\d.]*$")]
private static partial System.Text.RegularExpressions.Regex MachineLine();
/// <summary>riepilogo-prove.sh with no skipped test allowed, on one .trx file of the given results.</summary>
private async Task<(int Code, string Output, string Errors, string Report)> RunSummaryAsync(string bash, params (string Outcome, string Name, string? Message)[] results)
{
+12 -1
View File
@@ -122,12 +122,23 @@ public sealed partial class PipelineTests
}
// tests/Febe.Tests.Windows runs only on Windows: never «dotnet test» on the solution or without a project.
// Every run of the tests ends, naming the culprit, when a test is stuck for 20 minutes (no dump of the test host).
foreach (var name in new[] { "verifica.yml", "rilascio.yml" })
{
foreach (Match test in DotnetTest().Matches(Code(Workflow(name))))
var code = Code(Workflow(name));
var runs = 0;
foreach (Match test in DotnetTest().Matches(code))
{
Assert.AreEqual("tests/Febe.Tests", test.Groups["target"].Value, $"{name}: {test.Value}");
var end = code.IndexOf("--results-directory", test.Index, StringComparison.Ordinal);
if (code.AsSpan(test.Index + test.Length).StartsWith(" -c Release") && end > test.Index)
{
runs++;
StringAssert.Contains(code[test.Index..end], "--blame-hang-timeout 20m --blame-hang-dump-type none", $"{name}: {test.Value}");
}
}
Assert.AreEqual(name == "verifica.yml" ? 2 : 1, runs, $"{name}: le esecuzioni delle prove");
}
}