Skip to content

Heap-snapshot leak-regression harness #182

Description

@truthixify

Tier: M (2-4 days) | Type: test

Context. test/leaks/scan-leak.test.ts (PR #114) already writes a raw heap-final.heapsnapshot via v8.getHeapSnapshot() (lines 62-72) for CI debugging and asserts a regression slope on process.memoryUsage().heapUsed (line 113). What it does NOT do is diff retained-object counts by constructor across before-and-after snapshots, which is the failure mode we most fear after PR #154 (pipelined scan) and PR #156 (batch-path optimiser) landed: a retained WeakRef / buffer pool that leaks slowly. This issue adds the constructor-level diffing layer, publishes the artifact from the nightly job, and documents the harness.

Scope.

  • Extend test/leaks/ with a runner that takes structured v8 heap snapshots before / after N scans and parses retained-object counts by constructor.
  • Diff constructor counts, fail on growth over a configured threshold.
  • Bench on Node with --expose-gc so GC is deterministic.
  • Nightly job (not per-PR) publishes the diff as an uploaded artifact.

Acceptance.

  • Harness produces reproducible retained-object counts across two runs on the same commit
  • Regression injected in a spike branch fails the harness
  • Nightly CI publishes the diff as an artifact
  • Doc'd in test/leaks/README.md (new)

Files. test/leaks/heap-snapshot.test.ts (new), test/leaks/README.md (new), .github/workflows/ci.yml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programdripsFunded via Drips Networkhelp wantedExtra attention is neededperfPerformance / optimizationstellar-waveAuto-created for Wave 8testTest coverage / harnesswave-8Auto-created for Wave 8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions