Skip to content

Commit d8e4f75

Browse files
committed
test(objectql): load the package entry with hook-run-as.test.ts, not inside its case
The [#24497] "seed is no nameable member of the published face" case did `await import('./index.js')`, pulling the rest of the package's module graph inside the case's 5 s window: ~2.5 s on a quiet box, and 5.0-5.4 s (red, 5 of 5) with the CPU oversubscribed, matching both merge-queue ejections. The entry is now a static import, so that load is paid at file collection; the case's assertions are unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AN1CuLrAYkcsfrh1N5ffLT
1 parent 9753d16 commit d8e4f75

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/objectql/src/hook-run-as.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ import {
4747
} from './hook-run-as.js';
4848
import { assertEngineDeleteDispatch } from './engine-delete-dispatch.js';
4949
import { assertEngineUpdateDispatch } from './engine-update-dispatch.js';
50+
// [#26049] The published face, loaded with the file rather than inside the
51+
// case that reads it: the entry pulls the rest of the package's module graph,
52+
// which cost ~2.5 s inside that case on a quiet box and crossed its 5 s budget
53+
// under merge-queue load. Same module, same assertions; only where the load
54+
// is paid moved.
55+
import * as entry from './index.js';
5056
import type { Hook, HookContext } from '@objectstack/spec/data';
5157
import type { ExecutionContext } from '@objectstack/spec/kernel';
5258

@@ -386,8 +392,7 @@ describe('#14010 Hook.runAs — the identity a hook\'s ctx.api presents', () =>
386392
expect(userless.seen).toEqual([]);
387393
});
388394

389-
it('the seed is no nameable member of the published face: keyed on a symbol the package entry does not export', async () => {
390-
const entry = await import('./index.js');
395+
it('the seed is no nameable member of the published face: keyed on a symbol the package entry does not export', () => {
391396
expect('SEED_USER_GRANTS' in entry).toBe(false);
392397
expect(Object.getOwnPropertyNames(ScopedContext.prototype)).not.toContain('withUserGrantsSeeded');
393398
// [#25653] The app-authored hook api's derivation is the other symbol-keyed member, unexported too.

0 commit comments

Comments
 (0)