Skip to content

Make <Syntax> cancellation always release its reference #775

Description

@taras

Story

When a running <Syntax> reference is cancelled, its scoped cleanup always finishes before the test observes teardown, so cancellation evidence is deterministic.

Current gap

The existing SYN22: a cancelled reference tears down and commits no record case failed once at exact local revision 33a45a31558765ed9a647bd4a5add4c6c6b200e9, then passed without any source or test change. This is an intermittent lifecycle failure; the cause is not yet established.

The failure occurred during local feedback review, so there is no CI run link.

Evidence

Runtime:

deno 2.9.5 (stable, release, aarch64-apple-darwin)
v8 15.0.245.2-rusty
typescript 6.0.3

Failing command:

deno task test packages/core/tests/generated-xmd.test.ts packages/core/tests/evaluate-component.test.ts packages/core/tests/syntax-component.test.ts packages/core/tests/evaluation-profile.test.ts packages/core/tests/evaluate-provider-lifetime.test.ts packages/core/tests/evaluate-loaded-copy.test.ts packages/core/tests/syntax-loaded-copy.test.ts

First failure output:

Tier SYN — the record one occurrence keeps ... SYN22: a cancelled reference tears down and commits no record

- Expected  - 3
+ Received  + 1

- Array [
-   "released",
- ]
+ Array []
    expect(teardown).toEqual(["released"]);

FAILED | 40 passed (314 steps) | 1 failed (1 step) (6s)

Passing rerun, with no intervening change:

deno task test packages/core/tests/syntax-component.test.ts --filter 'record one occurrence keeps'
SYN22: a cancelled reference tears down and commits no record ... ok (22ms)
ok | 1 passed (4 steps) | 0 failed | 6 filtered out (194ms)

Acceptance

  • The cancellation case reliably observes reference cleanup before completing.
  • Focused lifecycle evidence rejects an implementation that merely makes the timing window less frequent.
  • The cause and regression evidence are recorded before this issue is closed; a green rerun alone does not close it.

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

    flakeIntermittent or timing-sensitive failure that can pass without a code change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions