all_tool_descriptions: first test pays every module's cold import inside the 5 s default timeout, red under load #14
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?
Purpose (fix):
src/all_tool_descriptions.test.tstests what it names, not how fast a loaded box imports every tool module."registers the same set of tool names regardless of MACULA_MCP_TERSE_TOOLS" is the first test to import every register module cold (
captureAllDescriptions). It does that inside vitest's default 5 s test timeout. On host00 under load (load average 11-14,nice -n 10, the whole suite in parallel) it times out at 5.0-5.2 s:2cb8721, from a clean tree;Alone it passes in about 0.4 s. CI's
testjob on PR 12 (run 6953, task 21989) was green, so this is a local-gate red, not a CI one.Done when
beforeAllwith its own timeout, or an explicit timeout on that test), and the test still fails when a tool's terse and full name sets differ.vitest runat load average 12 or more passes it three times in a row.Cause, measured on host00 (4 cores, a full
vitest run, 3 workers in parallel,nice -n 10):captureAllDescriptionsper module: 27 tool modules, the cold pass costs ~4.9 s, and five first imports dominate it --mesh_identity1.38 s (it carriesconnect_to_mesh,realm,citizenship,serve_rings),mesh_dht1.01 s,mesh_role0.91 s,mesh_call0.40 s,mesh_help0.39 s. The warm pass (terse) is 102 ms in total.So the fix is where the work sits, not a number: the discovery and both captures move into a
beforeAllwith its own 60 s timeout, computed once for both tests (they previously captured twice each), and the test bodies keep vitest's 5 s default for what they assert. No test-body timeout is raised.The test still fails when a tool's terse and full name sets differ: a tool registered only when
MACULA_MCP_TERSE_TOOLSis set made it fail (expected [ 'mesh_agents', …(35) ] to deeply equal [ 'mesh_agents', …(34) ]).Three full local
vitest runs in a row at load 12.6 / 12.8 / 13.4 (5-minute 19.3-20.0): 749 passed, 749 passed, 749 passed. (Run withMACULA_MCP_IDENTITYunset -- this shell exports it, and the unrelatednode_id.test.tsrefuses an agent and an identity both set.)