mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-07-27 07:00:59 +00:00
Self-review findings:
1. The preflight 'bad' fixture (testdata/preflight-migrations/bad_sync_migration.go)
contained the literal string 'RunAsyncMigration' in its descriptive comments.
The gate script (check-async-migrations.sh) greps a 25-line window above the
migration line for that identifier as an OK signal, so the fixture FALSELY
PASSED when it was supposed to be the negative-test sample. Rewrote the
comment to refer to the helper obliquely ('the async-migration helper').
Verified: bad fixture now exits 1, good fixture still exits 0.
2. async_migration_test.go covered only PendingThenDone. Added:
- PanicCapture: fn panic -> status='failed', error column populated
- IdempotentSecondCallNoOps: second call after done short-circuits
- RestartSafetyFailedIsRetried: seeded 'failed' row -> re-runs, error cleared
- RestartSafetyPendingIsRetried: seeded 'pending_async' row -> re-runs
- FnErrorRecorded: non-panic error path -> status='failed' + error captured
- ConcurrentSameNameSerialized: bounded fn-call count under N concurrent callers
3. MIGRATIONS.md: added 'Concurrency model' section documenting the single-process
/ single-writer reality (MaxOpenConns=1 + 5s busy_timeout), the cross-process
non-concern, and the live-ingest serialization implication for long fn. Added
'Scale budgets' section with the <30s target, the #1483 worked example, and
guidance for migrations that legitimately exceed the budget.
No public API changes to RunAsyncMigration.