test: global 90s timeout + document the hang-proof test workflow

Diagnosed the recurring 'tests hang' pain by measurement: the logic layer
is fast and reliable (dart test commons_core ~1s/82 tests; flutter test
test/services ~11s/124 tests, green), and only WIDGET tests hang — because
pumpAndSettle() waits for a screen to stop scheduling frames and a live
source (Drift/Nostr stream, periodic Timer, connectivity/plugin) never does,
so it sits at the 10-minute default and the run looks stuck.

- apps/app_seeds/dart_test.yaml sets timeout: 90s so such a test FAILS fast
  and names itself instead of blocking the whole run.
- CLAUDE.md now spells out the split-by-layer workflow (logic via
  dart test/flutter test test/services; widget tests targeted + timed out;
  never pumpAndSettle a live screen).
This commit is contained in:
vjrj 2026-07-11 00:26:55 +02:00
parent 21e4357970
commit 70fb7a463c
2 changed files with 19 additions and 3 deletions

View file

@ -0,0 +1,13 @@
# Global per-test timeout. Without it, a widget test that pumpAndSettle()s a
# screen with a never-settling source (a live Drift/Nostr stream, a periodic
# Timer, connectivity_plus, a plugin) waits at the 10-minute default and the
# whole run LOOKS hung. With this, such a test FAILS in 90s and names itself.
#
# The everyday, hang-proof gate is the logic layer, not widgets:
# dart test packages/commons_core # pure Dart, ~1s
# flutter test test/services # logic + in-memory DB, ~10s, no widgets
# Run widget tests targeted (flutter test test/ui/<file>), never blind, and
# never pumpAndSettle a live screen — pump(Duration) a bounded number of times.
#
# A genuinely slower (but finite) test can opt out with @Timeout(Duration(...)).
timeout: 90s