Prove che cadevano con il runner carico (#46)
Le prove cadevano a ogni carico della CI, ogni volta prove diverse. Dietro alcune c'erano difetti veri: FebeDatabase lasciava i file aperti dopo DisposeAsync (comandi SQLite non chiusi, pool di lettura chiuso dopo lo scrittore), e il WAL spariva durante lo spostamento della cartella Dati; la scheda dell'account senza statistiche leggeva i file di tutta la libreria; l'arresto di FebeApp non aspettava i lavori aggiunti da un avvio in corso. Chromium ha 120 s per avviarsi e aprire la prima scheda, e il ricollegamento smette appena il processo cambia. Nelle prove i limiti di tempo diventano protezioni contro un blocco: attese per condizione con un aiuto comune, limiti per classe nella prova di scala con il tempo migliore, porta 0 e stderr di Chromium nel browser delle prove, e la prova di «Scollega» di WebView2 controlla che il processo esca davvero. Provato su Windows con tutti i core occupati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e2e64c09e8
commit
0775a1460f
34 files changed
+875
-245
No files matched your search
@@ -13,6 +13,7 @@ using Febe.Browser.Targets;
|
||||
using Febe.Core.Abstractions;
|
||||
using Febe.Core.Collection;
|
||||
using Febe.Tests.Browser.TestSupport;
|
||||
using Febe.Tests.Support;
|
||||
|
||||
namespace Febe.Tests.Browser;
|
||||
|
||||
@@ -139,7 +140,11 @@ public sealed class BrowserIntegrationTests
|
||||
|
||||
var requested = await gestures.ScrollBurstAsync();
|
||||
requested += await gestures.ScrollBurstAsync();
|
||||
await Task.Delay(600);
|
||||
|
||||
// The scroll runs in the compositor after the events: by condition, not after a fixed time (#46).
|
||||
await TestWait.UntilAsync(
|
||||
async () => await Browser.EvalAsync<double>("window.scrollY") > 200 && await Browser.EvalAsync<int>("(window.__wheel && window.__wheel.count) || 0") >= 6,
|
||||
"la pagina scesa con la rotella");
|
||||
|
||||
var scrolled = await Browser.EvalAsync<double>("window.scrollY");
|
||||
var wheel = await Browser.Cdp.EvaluateAsync("window.__wheel");
|
||||
@@ -149,7 +154,7 @@ public sealed class BrowserIntegrationTests
|
||||
Assert.IsTrue(wheel.GetProperty("trusted").GetBoolean(), "Wheel events are trusted, as real ones.");
|
||||
|
||||
await gestures.ScrollBackAsync();
|
||||
await Task.Delay(400);
|
||||
await TestWait.UntilAsync(async () => await Browser.EvalAsync<double>("window.scrollY") < scrolled, "la pagina risalita");
|
||||
Assert.IsTrue(await Browser.EvalAsync<double>("window.scrollY") < scrolled, "A scroll back goes up.");
|
||||
}
|
||||
|
||||
@@ -225,7 +230,8 @@ public sealed class BrowserIntegrationTests
|
||||
|
||||
// S4 locally: click into a field through the remote view and type.
|
||||
await view.NavigateAsync(Browser.Site.Url("/modulo"));
|
||||
await Browser.Cdp.WaitForLoadAsync(Browser.Clock, TimeSpan.FromSeconds(10));
|
||||
Assert.IsTrue(await Browser.Cdp.WaitForLoadAsync(Browser.Clock, TimeSpan.FromSeconds(60)), "La pagina del modulo non ha finito di caricare.");
|
||||
await Browser.WaitForPaintAsync();
|
||||
await Task.Delay(RealBrowser.SettleAfterLoad);
|
||||
var field = await new TargetResolver(Browser.Cdp, TargetMap.Parse(Targets)).ResolveAsync("campo");
|
||||
Assert.IsTrue(field.Found, field.Message);
|
||||
|
||||
Reference in new issue
Block a user