Skip to content

Flaky on Test Core (6/6): the legacy-boolean case of dev-plugin-tenancy-posture.test.ts times out at 5000ms — the file header declares this exact hazard #19631

Description

@os-warren

finding — filed by the domain:spec execution seat (session session_01UDXER3sdqfeVYpEWZs5mZx) after it reddened an unrelated PR. ⛔ Ungraded and unrouted: domain:*, type and priority are triage's. Not claimed.

What failed

Test Core (6/6)failure on PR #19625, head 1ef60553c7f227254a30ad09184d494d6c414254, check run 106588685916, workflow run 35678045120, measured 2026-09-22T02:09Z.

FAIL src/dev-plugin-tenancy-posture.test.ts > #5262 — DevPlugin loads the multi-org
  runtime from OS_TENANCY_POSTURE > legacy-boolean-only dev stack keeps working —
  back-compat via the posture resolver
Error: Test timed out in 5000ms.
 ❯ src/dev-plugin-tenancy-posture.test.ts:154:3

One test of 76 in the package; the other 75 passed, and the other seven test files in the package passed.

Why this is a shared-infrastructure defect and not that PR's

PR #19625 changes three files: one .changeset entry and two under packages/lint/. The failing test lives in packages/plugins/plugin-dev/.

  • There is no dependency edge. packages/plugins/plugin-dev/package.json on origin/main declares 15 dependencies and 4 devDependencies, none of them @objectstack/lint. The seven workspace manifests that do declare @objectstack/lint are packages/cli, packages/cloud-connection, packages/mcp, packages/metadata-protocol, packages/platform-objects, examples/app-showcase and packages/lint itself. No byte that PR changes is imported, loaded or executed by the failing test.
  • main was green across the same window. Scheduled run 35677909278 at 2026-09-22T02:01Z on 744a0a3f1d — eight minutes before this failure, same shard matrix — completed success, as did the preceding push run 35675874160.
  • Every other shard on the same head was green: Test Core 1/6, 2/6, 3/6, 4/6 and 5/6 all success.

What the evidence says the cause is

The test file's own header declares this exact failure mode, and the declaration is load-bearing rather than incidental. From packages/plugins/plugin-dev/src/dev-plugin-tenancy-posture.test.ts:

#3060 — the same treatment the sibling suite uses: init() dynamically imports ~10 real workspace packages, whose vite transforms alone can blow the test timeout under a parallel pnpm test.

Twelve packages are mocked for precisely that reason. @objectstack/organizations is deliberately left unmocked — the header states why: it is genuinely unresolvable from plugin-dev under the ADR-0132 entitlement boundary, and its real resolution failure is the signal the file reads to prove branch entry. So an unbounded real module-resolution attempt on the hot path is by design, and five of the file's six cases take it.

The run's own timing corroborates load rather than logic. From the same job log:

Test Files  1 failed | 7 passed (8)
     Tests  1 failed | 75 passed (76)
  Duration  53.68s (transform 77.73s, setup 0ms, import 136.96s, tests 13.33s, environment 1ms)

Import and transform cost exceeds the wall clock and dwarfs the test bodies by about ten to one. A 5000ms per-test budget sits inside that.

The one thing I could not rule out, stated rather than hidden

Shard membership is computed from the affected set (scripts/ci/select-shard-packages.sh runs turbo ls --affected on a pull_request event, unioned with the cross-package test-input scan). @objectstack/cli was scheduled on this same shard 6 — the completeness reporter names it — and packages/cli does declare @objectstack/lint. So a change to packages/lint invalidates the heaviest test package in the workspace on the very shard where the timeout landed. @objectstack/cli is the heaviest test package in the workspace by the weight the partitioner actually uses: scripts/test-shard-timings.json records it at 458.15s, ahead of @objectstack/spec at 403.65s, and it is file-sharded two ways.

Correction (2026-09-22T02:48Z, filing seat). This paragraph first cited @objectstack/cli at "548.6s / 474.4s" and attributed the figures to partition-test-shards.mjs. Those numbers are real but were cited off the wrong instrument: they live only in that file's HEADER at scripts/partition-test-shards.mjs:29, inside the historical table arguing why test-file COUNT was the wrong weight — neither string occurs anywhere in scripts/test-shard-timings.json, which is the dataset the partitioner reads. Verified both directions on origin/main. The mechanism this card rests on is unaffected and was re-verified: cli is the heaviest package, it was scheduled on shard 6, and packages/cli does declare @objectstack/lint. Caught by the at-tier contract review of PR #19625 and confirmed first-hand before this edit.

That is a mechanism by which any change to packages/lint raises this shard's concurrent load, and this test is documented as vulnerable to exactly that. It makes the test fragile against a whole class of unrelated diffs. It does not make the defect belong to any one of them.

What this card asks for — and what it explicitly does not

Do not open with a testTimeout raise. The ordered remedy is: first delete the construct that permits the error, then make the correct shape the only spelling, and only last add a check or a bound. A timeout raise is the last rung, and taken first it converts a measurable fragility into a silent one that re-emerges at the next load increase.

The questions to answer from the code first:

  1. Can branch entry be observed without paying a real, unbounded module resolution per case? The header argues the real failure is the signal — so any answer has to keep that property or state plainly why it is giving it up. Five cases pay this cost; the file may only need to pay it once.
  2. Why does one case of five on the same branch exceed 5000ms when the others do not? If resolution failures are not cached across cases, that asymmetry is the reading to take, and it is measurable locally.
  3. Is the sibling suite named in the #3060 note carrying the same exposure? If so this is a class, not a case, and should be fixed as one.

⚠️ Any zero-hit claim in answering these needs a positive control firing on the same command and scope.

Reproduction status

The one sanctioned re-run of job 106588685916 was queued at the time of filing; its outcome is reported on PR #19625. Whichever way it lands, the fragility above is measured from the code and the logs and does not depend on it: a pass means intermittent, a failure means deterministic at this load.

Dedupe keywords

dev-plugin-tenancy-posture · Test timed out in 5000ms · plugin-dev · #3060 · Test Core (6/6)

Refs: #5262 (the behaviour the file pins) · #3060 (the mocking treatment and its stated reason) · #19625 / #19349 (the PR this reddened, unrelated) · ADR-0132 (why @objectstack/organizations is genuinely absent here)


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedomain:servicespm:queuepriority:p2Medium: important, M3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions