Stability/soak testing infrastructure #6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Add comprehensive stability and soak testing infrastructure to go-postgres, covering native, WASM, and container environments.
Implemented (task/WTstable branch)
Packages
memcheck/— Memory monitor package withStats,Monitor,FormatBytes. WASM build tag setsdebug.SetMemoryLimit(900MB). Reusable by gobank.soakwork/— Reusable workload engine: interest-calculation simulation with configurable batch size, delete threshold, and reporting interval.translate_cache.go— Query translation cache (FIFO eviction, default 1000 entries).TranslateCached()wrapsTranslate().Test infrastructure
soak_test.go— Native soak test (TestSoakNative), file-backed DB, configurable viaSOAK_DURATIONenv var (default 5m), 512MB memory limit.translate_bench_test.go— Benchmarks for tokenizer, translation passes, full translate, and cached translate.cmd/soakwasm/— Browser WASM soak test with discovery (run until OOM) and sustained (with deletion) modes.cmd/soakserve/— HTTP server for the WASM soak test.Containerfile— Container image for long-running soak tests (distroless, pure Go).Taskfile tasks
bench,test:soak,test:soak:long,soak:wasm:build,soak:wasm,container:build,container:run,container:run:oomKey results
Cache provides ~1500x speedup with zero allocations on hit.
10s native soak: 802KB final alloc, 44 GC cycles — memory is well-controlled.
Remaining work
TranslateCachedinto the driver (behind a flag or as default)Migrated from Codeberg: originally #6, opened 2026-03-20.