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
@@ -221,14 +221,21 @@ internal sealed class AccountStore(FebeDatabase db) : IAccountStore
|
||||
}
|
||||
}
|
||||
|
||||
var bytes = c.Command("""
|
||||
SELECT COALESCE(SUM(m.bytes), 0) FROM media m JOIN entry e ON e.id = m.entry_id
|
||||
WHERE e.account_id = @a AND m.state IN ('Downloaded', 'Imported')
|
||||
""").With("@a", accountId).ScalarInt64();
|
||||
var pending = c.Command("""
|
||||
SELECT COUNT(*) FROM media m JOIN entry e ON e.id = m.entry_id
|
||||
WHERE e.account_id = @a AND m.state IN ('ToDownload', 'Expired')
|
||||
""").With("@a", accountId).ScalarInt64();
|
||||
// One pass over the account's files, driven from its entries (CROSS JOIN keeps entry as the outer loop):
|
||||
// without ANALYZE statistics SQLite otherwise starts from the media state index and reads the files of
|
||||
// the whole library for one account's card (#46).
|
||||
long bytes, pending;
|
||||
using (var r = c.Command("""
|
||||
SELECT COALESCE(SUM(CASE WHEN m.state IN ('Downloaded', 'Imported') THEN m.bytes END), 0),
|
||||
COALESCE(SUM(m.state IN ('ToDownload', 'Expired')), 0)
|
||||
FROM entry e CROSS JOIN media m ON m.entry_id = e.id
|
||||
WHERE e.account_id = @a
|
||||
""").With("@a", accountId).ExecuteReader())
|
||||
{
|
||||
r.Read();
|
||||
bytes = r.GetInt64(0);
|
||||
pending = r.GetInt64(1);
|
||||
}
|
||||
var collections = c.Command("SELECT COUNT(*) FROM highlight WHERE account_id = @a AND removed_at IS NULL")
|
||||
.With("@a", accountId).ScalarInt64();
|
||||
|
||||
|
||||
Reference in new issue
Block a user