Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mcpx test inventory (deliverable 1 of #1960)

Recounted on current main at 32d47f73b (2026-11-03). This refresh supersedes the 2026-10-30 census at dd2c88ff and the older pre-re-home issue table.

Current census

Scope: Go *_test.go files under pkgs/mcpx/. The counts are a repeatable source scan, not a judgment that every marker is flaky or unsafe. Test subtests are not counted separately.

  • Test files: 468; Test* functions: 2561; Fuzz* functions: 1.
  • time.Sleep: 73 files / 178 calls; time.Now: 87 files / 280 calls; []struct tables: 117 files / 235 matches.
  • math/rand: 2 files; crypto/rand: 10 files; net.Listen: 8 files / 10 calls; httptest: 70 files / 317 references; t.Parallel: 0 files / 0 calls.
  • The single native fuzz target is internal/config/stripjsonc_fuzz_test.go:FuzzStripJSONC; its corpus runs during ordinary go test, while mutation requires -fuzz. The package-level table below flags where to inspect; it does not classify every sleep or clock read as a flake.

Per-package census

Counts are Test* functions / test files. Marker columns are matching files/calls; randomness columns are files importing/referencing the package path. — means no match. Generator candidates are a shortlist, not implemented generators.

PackageTests / filesFuzzSleep files / callsNow files / callsTable files / matchesmath/rand filescrypto/rand filesnet.Listen files / callshttptest files / refsGenerator candidate
internal/e2e356 / 62—15 / 3314 / 4724 / 4911—2 / 2exec.flagset; api.v1request
internal/daemon311 / 78—11 / 2519 / 5222 / 44113 / 535 / 191request/operation shapes
internal/config217 / 201——4 / 37————config.layers; FuzzStripJSONC exists
internal/mcpserver173 / 31—10 / 237 / 297 / 10—1—4 / 41request shapes
internal/cli170 / 48—4 / 62 / 135 / 5—13 / 35 / 12—
internal/mcpclient131 / 36—10 / 188 / 286 / 7——1 / 18 / 21—
internal/runner111 / 7—1 / 13 / 54 / 11———1 / 1—
internal/pool96 / 23—6 / 98 / 284 / 4—1—4 / 16—
internal/settings72 / 20———5 / 8————settings.precedence
internal/codegen69 / 7———1 / 2———1 / 5codegen.jsonschema
internal/execsvc46 / 11—2 / 21 / 13 / 3—————
internal/logging42 / 5——1 / 51 / 4—1——redaction inputs
internal/elicit39 / 8—1 / 23 / 162 / 2—1———
internal/launcher38 / 2————————launcher.template
internal/artifacts35 / 6—1 / 12 / 51 / 1—1——artifact-name parsing
internal/deps31 / 1———1 / 2—————
internal/logstore31 / 5——2 / 4——————
internal/tasks31 / 4—1 / 132 / 51 / 1—1———
internal/adapter30 / 2—————————
internal/diagnose30 / 3——1 / 81 / 2————diagnostic parser inputs
internal/preflight30 / 2—————————
internal/recipes28 / 3———1 / 3—————
internal/api26 / 8—————————
tools/docs-history25 / 1—————————
internal/registry22 / 2—1 / 11 / 12 / 4———2 / 4—
internal/conformance21 / 14—7 / 374 / 114 / 4———4 / 8—
internal/hooks21 / 4—2 / 52 / 4——————
internal/source21 / 3———2 / 2——1 / 1——
internal/tui21 / 2——1 / 2——————
internal/openapi20 / 1———1 / 1———1 / 5schema/parser shapes
internal/secrets20 / 3——1 / 31 / 2—————
internal/mcpauth17 / 3———1 / 1—————
internal/cache16 / 2——1 / 4——————
internal/events16 / 3—————————
internal/model15 / 1———1 / 2———1 / 8—
internal/searchpath15 / 1————————path parser shapes
internal/testsupport15 / 4——1 / 12 / 2—————
internal/schemaval13 / 1———1 / 2———1 / 1schema shapes
internal/progspec12 / 1—1 / 21 / 21 / 1—————
internal/testsupport/gen12 / 2—————————
internal/catalog11 / 4———————1 / 2—
internal/mcpspec11 / 1———1 / 3—————
internal/plugin11 / 1—————————
internal/scripting9 / 1———1 / 3—————
internal/wasmtools9 / 1—————————
internal/eventstore8 / 1—————————
internal/nearmiss8 / 1———1 / 4—————
internal/defaults6 / 3—————————
internal/mcpheaders6 / 1———1 / 4—————
internal/opencode5 / 2——1 / 4——————
internal/policy5 / 1———1 / 2—————
internal/refdoc5 / 1—————————
internal/spec5 / 1———1 / 1—————
internal/randsrc4 / 1—————1———
internal/sdnotify4 / 1——1 / 2——————
internal/buildcheck2 / 2—————————
internal/probe2 / 1———1 / 1—————
internal/seedstore2 / 1—————————
examples1 / 1—————————
internal/dashboard1 / 1—————————
internal/testsupport/taskmcp1 / 1———1 / 1—————

Generator and flake-review shortlist

  • Pure/table-shaped candidates: codegen.jsonschema, launcher.template, config.layers, settings.precedence, redaction inputs, parsers (openapi, searchpath, schemaval, artifacts/name, diagnose), and request/operation shapes in daemon/mcpserver. Existing tables are candidates to generalize, not a request to fuzz every test.
  • Current sleep hotspots by calls/files: internal/conformance (37/7), internal/e2e (33/15), internal/daemon (25/11), internal/mcpserver (23/10), internal/mcpclient (18/10), internal/tasks (13/1), and internal/pool (9/6). Inspect each call site for sleep-then-assert before labeling it flaky; intentional delays and deadline polling are not automatically flakes.
  • net.Listen and httptest counts identify tests that bind local sockets. Confirm listeners use ephemeral ports or Unix sockets and are closed; counts alone do not show a port conflict.

Counting command

Counts above use Go test declarations and simple regex scans of test-file contents. Re-run the named scans above after source changes; review flagged contexts before changing tests.

Seed and fuzz implementation references

  • Seeded generators live in internal/testsupport/gen; stream derivation v1 is keyed by run seed, test name, and generator name@version. Generators draw only from gen.Source; native fuzz adapters use gen.NewBytesSource(data).
  • CI run-seed records are stored under testdata/seeds/v1; the collector workflow is the writer. The seed-store README defines which run records are retained.
  • The fuzz corpus for FuzzStripJSONC is under internal/config/testdata/fuzz/FuzzStripJSONC/. Ordinary unit tests replay it; .github/workflows/mcpx-test.yml runs the bounded mutation smoke. Long fuzz/soak work remains separate.

History

The prior detailed review was measured at dd2c88ff and is superseded by this recount. Its exact file/line references and classifications should be rechecked against current source before reuse.