Skip to content

Commit 24c4208

Browse files
committed
test(dogfood): time the package-less tool row pin's reads, not its three installs
The AI-family pin saved two rows and ran three install-locals inside one `it`, so vitest's default 5 s test clock timed loading: each install re-syncs the whole showcase (~0.9 s idle), and under queue shard load the test crossed 5 s. The saves and installs move to a nested describe's beforeAll with a loading budget; the before/after-hydrator reads become two its with unchanged assertions. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRabTH2KkTRU4d62Uq
1 parent f06f064 commit 24c4208

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

‎packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts‎

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,24 +377,39 @@ describe('agent, skill and tool names held per namespace, on a booted showcase',
377377
* other. FROM (this branch before `main`'s #32741 was merged in): the
378378
* first-installed holder's exact address served the package-less row as its
379379
* own; the second served its own.
380+
*
381+
* The two row saves and the three installs are this pin's SETUP, so they run
382+
* in the `beforeAll` below and the `it`s time only the reads they judge
383+
* (clocked windows measure behaviour, never loading). Measured: each
384+
* install-local re-syncs the whole showcase (123 object schemas, 33 flows),
385+
* ~0.9 s apiece on an idle box; the setup was ~2.8 s of a ~3.1 s test, and
386+
* under merge-queue shard load the single `it` crossed vitest's default 5 s
387+
* test clock (2.2–4.4 s green, 5.0–5.1 s red). The hook's budget is a
388+
* loading budget, like the boot hook's above.
380389
*/
381-
it('[#31985] a package-less tool row saved before two namespaces\' packages install the name is declined at each holder\'s exact address, both install orders, before and after the hydrator; the bare read refuses naming both', async () => {
390+
describe('[#31985] a package-less tool row saved before two namespaces\' packages install the name', () => {
382391
const UP = 'qa_row_tool_up';
383392
const DOWN = 'qa_row_tool_down';
384-
for (const name of [UP, DOWN]) {
385-
const saved = await stack.apiAs(admin, 'PUT', `/meta/tool/${name}`, tool('env', name));
386-
expect(saved.status, await saved.text()).toBeLessThan(300);
387-
}
388-
for (const [p, tools] of [['kappa', [UP]], ['lambda', [UP, DOWN]], ['iota', [DOWN]]] as const) {
389-
const { status, body } = await installLocal(inline(p, { tools: tools.map((n) => tool(p, n)) }));
390-
expect(status, `${p}: ${JSON.stringify(body)}`).toBeLessThan(300);
391-
}
393+
394+
beforeAll(async () => {
395+
for (const name of [UP, DOWN]) {
396+
const saved = await stack.apiAs(admin, 'PUT', `/meta/tool/${name}`, tool('env', name));
397+
expect(saved.status, await saved.text()).toBeLessThan(300);
398+
}
399+
for (const [p, tools] of [['kappa', [UP]], ['lambda', [UP, DOWN]], ['iota', [DOWN]]] as const) {
400+
const { status, body } = await installLocal(inline(p, { tools: tools.map((n) => tool(p, n)) }));
401+
expect(status, `${p}: ${JSON.stringify(body)}`).toBeLessThan(300);
402+
}
403+
}, 60_000);
404+
392405
const layeredAt = async (name: string, pkg: string) => {
393406
const r = await stack.apiAs(admin, 'GET', `/meta/tool/${name}/layers?package=${pkg}`);
394407
const body = (await r.json()) as any;
395408
return [r.status, body?.overlay ?? null, body?.effective?.label];
396409
};
397-
for (const when of ['before the hydrator', 'after the hydrator']) {
410+
411+
// In declaration order: the second runs the hydrator (`GET /meta/tool`) first.
412+
it.each(['before the hydrator', 'after the hydrator'])('%s: it is declined at each holder\'s exact address, both install orders; the bare read refuses naming both', async (when) => {
398413
if (when === 'after the hydrator') expect((await stack.apiAs(admin, 'GET', '/meta/tool')).status).toBe(200);
399414
for (const [name, holders] of [[UP, ['kappa', 'lambda']], [DOWN, ['lambda', 'iota']]] as const) {
400415
for (const p of holders) {
@@ -404,7 +419,7 @@ describe('agent, skill and tool names held per namespace, on a booted showcase',
404419
}
405420
await expectMetaRefused('tool', name, holders.map((p) => `com.qa.bare.${p}`));
406421
}
407-
}
422+
});
408423
});
409424
});
410425

0 commit comments

Comments
 (0)